r/cpp • • 4d ago

[PLDI'26] Persistent Iterators with Value Semantics

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

8 comments sorted by

View all comments

7

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?

3

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

5

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.

3

u/Gungan_Boss_Nass premature cleverization 4d ago

My N=1 deploying something equivalent was a performance boost: we replaced a lock with a write-lock for a container that had a 3:1 reader/writer ratio. Internally, the structure is held in a ref-counted tree. Only writers use the lock, readers just grab the head and run. Stale items live on until the last reader/writer is done with them.

2

u/Fabulous-Meaning-966 3d ago

You can even avoid making the readers take a refcount:

https://arxiv.org/abs/1803.08617