Improving Performance and Maintainability in Modern C++
summary
Refactors of the PARSEC fluidanimate port replace chunky global state and handcrafted memory pools with a vector of Particle and standard allocators, move constants into constexpr/templated holders, and separate concurrency into a small library YAPL with policy-driven mutexes (including a null mutex). Results: ~20–25% fewer LOC, cyclomatic max drops from 61/3333 to ~12, 20% fewer instructions and 40% fewer branch instructions, sequential is ~10% faster and parallel on an i7 is ~40% faster versus the original TBB version (measured with Linux perf, GCC).
AI-written summary · about
chapters (27)
- 0:00Start
- 2:54Common Assumptions
- 6:36Parsec Benchmark
- 16:05Memory Management
- 20:06Refactorings
- 23:10Simulation Constants
- 23:40Data Structures
- 24:34Where Do I Place My Constant
- 25:13Constants Generic
- 28:43Global Data Structures
- 29:15Premature Optimizations
- 30:03Simplification by Abstraction
- 32:02Debate between a Structure of Arrays and Arrays of Structure
- 33:13Inter Particle Locality
- 38:38What Is a Cube
- 41:45Generic Namespaces
- 42:32Policy Aggregator
- 43:15Sequential Program
- 44:29Simulation Grid
- 46:27Advance the Simulation
- 51:17Complexity
- 52:47Performance
- 53:27Normalized Execution Time
- 59:04Final Things
- 1:00:00Final Remarks
- 1:02:08Do Not Optimize
- 1:03:48Regression Testing
related talks
01h 07mMore Speed & Simplicity: Practical Data-Oriented Design in C++
01h 00mMoving Faster: Everyday efficiency in modern C++
49mAn Engineering Approach to Optimising C++
01h 02mFunctional C++
01h 33mGPU programming with modern C++
01h 06mModern C and What We Can Learn From It
01h 26mFrictionless Allocators
27m“From security to performance to GPU programming..."
