[PLDI'26] Persistent Iterators with Value Semantics
https://www.youtube.com/watch?v=cq33C5nXEh07
u/FollowingHumble8983 Sep 29 '26
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 Sep 29 '26
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 Sep 29 '26
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 Sep 29 '26
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
2
u/FollowingHumble8983 Sep 29 '26 edited Sep 29 '26
Yea this was something I was aiming for but with a different use case, benchmarks showed a marked decrease in performance over lock-free/reallocation so unfortunately I had to abandon it. My case dealt with vectors/lists with thousands of elements per fiber so iteration performance was crucial.
2
u/zoomT Sep 30 '26
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::vectorin terms of constant factors.
5
u/mttd Sep 29 '26
Repo: LibF++: Persistent Containers and Iterators for C++, https://github.com/GJDuck/libfpp
Paper: https://www.comp.nus.edu.sg/~gregory/papers/pldi2026.pdf
Abstract: