More Speed & Simplicity: Practical Data-Oriented Design in C++
summary
A live particle demo refactors an OOP design (vector<unique_ptr<Entity>, virtual dispatch, heap allocs) into data‑oriented layouts (separate vectors for rockets/emitters/particles, index handles, vector<optional> slots), then to structure-of-arrays (SoA) with helper templates and boost::pfr. Benchmarks show original worst cases hitting ~21.6 ms/frame at 1M entities, the DOD refactor yields ~70% decrease in update time and another SoA pass adds ~32% more improvement; rendering becomes ~8× then ~2× faster. OpenMP parallel loop and C++17/C++26 reflection paths are used and the demo runs noticeably smoother.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:45Data-oriented design overview
- 2:58Live demo and performance
- 5:25Object-oriented implementation
- 9:04Managing entity relationships
- 12:10OOP performance analysis
- 14:12Hardware and memory hierarchy
- 19:07Inefficiencies in OOP
- 23:34Mindset shift
- 26:41Data-oriented design principles
- 29:30Data-oriented implementation
- 36:31Performance and simplicity
- 40:39Cognitive overhead and coupling
- 43:33Tooling and opportunities
- 49:05Multithreading advantages
- 50:31Refining data layout
- 52:00Structure of Arrays (SOA)
- 55:26Advanced SOA techniques
- 59:31Conclusion
related talks
01h 21mImproving Performance and Maintainability in Modern C++
01h 05mImplementation of a component-based entity system in modern C++
05mMaximising Throughput & Minimising Latency in High-Performance C++ Code
01h 00mMoving Faster: Everyday efficiency in modern C++
44mC++ Performance and Optimisation
35mAlgorithmic and microarchitecture optimizations of C++ applications
01h 20mBetter Code: Relationships
55mHow to "OO" in C++
