mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 20:27:03 +00:00
An interval object stores five booleans: start()->is_inclusive(), a boolean since start() itself is an std::optional, two more for end(), and is_singular(). Due to bad packing, these five booleans occupy 8 bytes each, for a total of 40 bytes. Re-pack the interval class by storing those booleans explicitly close by. Since we lose std::optional's ability to store a maybe-constructed object, we re-implement it using anonymous unions and therefore have to implement the 5 special methods. This helps saves space when vectors of intervals are used, as seen in #3335 for example.