TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25221 21
Neoclassical C++: segmented iterators revisited (1)

Hi,

I 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 them game.

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

Happy to receive feedback!

https://redd.it/1th1e21
@r_cpp
template<class BoostedCpp> Neoclassical C++: segmented iterators revisited (1) Introduction to segmented iterators The legendary STL library has been an inspiration in the development of the C++ language and libraries. The understanding of the concepts and code developed by S…
More from @r_cpp
  1. Oct 3, 2026C++ Show and Tell - October 2026 Use this thread to share anything you've written in C++.…
  2. Oct 3, 2026C++ future at Adobe So if anyone was still curious what happened to Hylo, or where Adobe s…
  3. Oct 3, 2026C++ Jobs - Q4 2026 Rules For Individuals --------------------- * **Don't** create top-leve…
  4. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  5. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  6. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →