~/talk

Immutable Data Structures in C++

Talkat ACCU 2024 · 2024-04-17..04-20· [c-and-cpp, concurrency]
links:none on file
slides:none on file

Shows that C++’s reference semantics cause real production bugs (iterator invalidation from concurrent push_back) and that passing heavy objects by value fixes races but costs copies. Introduces persistent vectors (tree of fixed-size arrays, structural sharing, branching factor ≈32) where lookup and append are O(log_32 n) — effectively constant (e.g., a billion → ~5 levels, a trillion → ~8). Implements push_back by copying only the path nodes, reusing most memory; benchmarks aren’t exhaustive but ICFP 2017 C++ results report reasonable performance vs std::vector.

AI-written summary · about

  1. 0:00Immutable data structures intro
  2. 3:18Value vs reference semantics
  3. 17:00Value semantics challenges
  4. 27:56Persistent data structures
  5. 36:22Safety vs performance trade-offs
  6. 38:10Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.