r/cpp • u/igaztanaga • Apr 07 '26
Inside Boost.Container: comparing different deque implementations
I put together a comparison of std::deque internals across libc++, libstdc++, MSVC STL, and boost::container::deque (Boost 1.90). The article looks at the internal data structures, member layouts, sizeof(deque), and includes some benchmarks on common operations.
Boost 1.90 shipped a complete rewrite of its deque — the old SGI-derived layout was replaced with a more compact design (32 bytes vs the previous 80). The article digs into what changed, how the new implementation compares to the three standard library implementations, and how much block size alone affects performance across all of them.
https://boostedcpp.net/2026/03/30/deque/
Note: thanks to the info provided by u/HowardHinnant, I've update the article with additional info about the noexcept-ness of default and move constructors across implementations.
View all comments
Show parent comment
1
u/encyclopedist Apr 09 '26 edited Apr 09 '26
The best known is probably
plf::stack(from the same author asplf::hive). He also has a document describing fast method of computing location of the element https://plflib.org/matt_bentley_-_pot_blocks_bit_tricks.pdfThere were others discussed here on reddit, but I don't remember.
Edit: it appears I misremembered.
plf::stackis a linked list of blocks and does not support random access. I must have seen somewhere else. Which may be evidence that this not a well-known data structure.Edit 2: Another example is
tbb::concurrent_vectorImplementation of index calculation is here: https://github.com/uxlfoundation/oneTBB/blob/master/include/oneapi/tbb/detail/_segment_table.h#L323-L336