u/igaztanaga

Neoclassical C++: segmented iterators revisited (1)
▲ 62 r/cpp

Neoclassical C++: segmented iterators revisited (1)

Hi,

I've written a blog post revisiting Matt Austern's great Segmented Iterators and Hierarchical Algorithms paper (2000) and benchmarking an experimental implementation I've been playing with in Boost.Container.

Quick idea: std::deque and friends are internally segmented (blocks of contiguous memory), but STL-like iterators hide that, so every ++it has to check for a block boundary. Austern's proposal splits the iterator into a segment_iterator (walks blocks) + local_iterator (inside one block), so algorithms can run a tight loop per block and only do bookkeeping at the boundaries.

I benchmarked several "simple" STL algorithms on a Boost deque, and the speedup is way bigger than Austern's original estimation when modern auto-vectorizers enter the game.

Article link: https://boostedcpp.net/2026/05/18/neoclassical-c-segmented-iterators-revisited-1/

Happy to receive feedback!

u/igaztanaga — 1 day ago
▲ 63 r/cpp

Hi to all, I'm glad to announce that the proposed boost::container::hub container has been ACCEPTED. Congrats u/joaquintides !

More details here:

https://lists.boost.org/archives/list/boost@lists.boost.org/thread/7WZ7QTPE2YDYD5OYCKXKKV2N74JHJRZL/

Reminder:

hub is a sequence container with O(1) insertion and erasure and element stability with great performance (see these benchmarks): pointers/iterators to an element remain valid as long as the element is not erased. hub is very similar but not entirely equivalent to C++26 std::hive (hence the different naming, consult the section "Comparison with std::hive" for details).

reddit.com
u/igaztanaga — 22 days ago