r/cpp • • 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.

67 Upvotes

13 comments sorted by

View all comments

Show parent comment

3

u/igaztanaga Apr 10 '26

One of the typical uses of deque is a FIFO data structure. In that case, the programmer would always push_front and pop_back. In that case, if elements are not moved when push-backing, the block size would just grow without limit.

1

u/matthieum Apr 10 '26

Ouch, yes, definitely need handling :P