C++ Relocation - How to Achieve Blazing Fast Save and Restore and More!
Talkat CppCon 2024 · on Tuesday, 2024-09-17· at 09:00· Cottonwood 8/9, 6700 North Gaylord Rockies Boulevard·
summary
Claims that transforming objects into columnwise structures of arrays and using Type Erasure tailored for relocatability removes millions of tiny allocations and pointer chasing, yields better-than-virtual-polymorphism performance, and makes save/restore a simple memory dump or memory-mapped buffers. Describes concrete tools: handles + stable indices (forward/back maps), an efficient map/flat_set approach, and a new Value Manager concept for allocation control. Provides proofs of concept and performance anecdotes (7% CPU spent on dealloc at Google) and reports measurable speed and allocation reductions.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:04Relocation in C++
- 5:27Traditional OOP problems
- 14:15Column-wise data
- 20:35Entity component systems and handles
- 29:11Data orientation limits
- 31:00Advantages of relocation for performance
- 36:18Fragmentation management
- 39:31Stable indices and maps
- 42:02Relocation beyond performance
- 43:50Memory locality issues
- 47:38Use cases for relocation
- 49:01Production challenges
- 51:33Standard library gaps
- 53:45Language improvements
- 54:49Conclusion
related talks
08mTrivially Relocatable
01h 01mBreaking Dependencies - C++ Type Erasure - The Implementation Details
01h 03mTaming dynamic memory
01h 05mThe Most Important Optimizations to Apply in Your C++ Programs
50mDesigning and Implementing a new Allocator model
01h 00mIntroduction to Hardware Efficiency in Cpp
07mThe Tragedy of the value based architecture
50mTwo advanced PMR techniques in C++17/20
