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

2

u/igaztanaga Apr 10 '26

Yeah, a lot of blocks mean a lot of allocation and deallocation calls. MSVC team inherited that small block size from the Dinkumware STL and they can't change it without breaking ABI. ABI stability is at the same time, a strong point for some users and a week point for others.

I guess they could offer a dirty, macro-based approach to select a bigger block size, but those macro-based solution are always a ODR-nightmares, unless they somewhat mangle std::deque with a different symbol...

u/STL is probably counting the days until the ABI breakage is allowed by MS to implement the list of improvements he surely has collected.