Opened 5 years ago
Last modified 5 years ago
#13016 new Feature Requests
small buffer optimization for bool vector or dynamic_bitset
Reported by: | Owned by: | jsiek | |
---|---|---|---|
Milestone: | To Be Determined | Component: | dynamic_bitset |
Version: | Boost 1.64.0 | Severity: | Optimization |
Keywords: | Cc: |
Description
The small_vector addition (#9165) is great. However using this with Booleans gives space overhead. The std has anticipated this with the vector<bool> concept though not everybody is enthusiastic about this optimization. Unfortunately this one always allocates its data on the heap. What I need is the optimization of vector<bool> (or a dynamic_bitset) with the small buffer optimization.
The use case is that I keep bool (or a bit postion) for every connected pin which goes from 0 to max pins. 99% of the use cases the maximum pins are less than 10 though I do not want to set a maximum on it beforehand (so e.g. use of std::bitset with 32 values would rule this out, since that one is topped to 32).
Change History (1)
comment:1 by , 5 years ago
Component: | container → dynamic_bitset |
---|---|
Owner: | changed from | to
Sorry but Boost.Container refused to have a boolean specialization for vector due to problems reported from std::vector and the idea is not to support any specialization for othe containers. More information here:
http://www.boost.org/doc/libs/1_64_0/doc/html/container/Cpp11_conformance.html#container.Cpp11_conformance.Vector_bool
Maybe this should proposed for Boost.DynamicBitset. Reassigning.