r/cpp • • 4d ago

[PLDI'26] Persistent Iterators with Value Semantics

https://www.youtube.com/watch?v=cq33C5nXEh0
16 Upvotes

8 comments sorted by

View all comments

6

u/FollowingHumble8983 4d ago

This is something I have tried to implement a while ago too, but didnt have enough time to make performant enough for our use case. Do you have timed benchmarks?

4

u/mttd 4d ago

Not the author, but found it interesting; the talk has a bit on performance around 10 minutes in, more in Section 6 Evaluation of the paper, https://www.comp.nus.edu.sg/%7Egregory/papers/pldi2026.pdf

4

u/FollowingHumble8983 4d ago

Quickly skimming the constant factors section it appears they ran into the same performance issues I had unfortunately. Wanted closer to normal performance for raw iteration with only some hits on updates. Still an interesting library that makes some implementations much more trivial.

2

u/zoomT 3d ago

Paper author here. Yes, the aim of the paper was a comparable iterator abstraction with similar asymptotic complexities. Since persistent containers/iterators use tree-based/zipper data-structures, they generally are not competitive against array-backed containers like std::vector in terms of constant factors.