New (& Old) C++ Standard Library Containers - How to Choose the Right Container in C++26 and Beyond
summary
Shows that naive container choice costs huge time: a simulation spikes 100× with scaling and one rewrite cuts a 7h15 run to ~30 minutes by recycling temporaries (implements a simple recycling bin of vectors and a vector-of-vectors fallback). Reveals real-world surprises: Microsoft deque effectively uses block size 1 so behaves like nodes, and vector<bool> massively misleads. Surveys concrete new/coming options and tradeoffs including in_place_vector (C++26) and the Hive/sequence proposals with modes that eliminate many common growth and locality pitfalls.
AI-written summary · about
chapters (14)
- 0:00C++ standard library containers
- 1:09Performance and containers
- 8:59Vector growth patterns
- 19:15Vector bool pitfalls
- 23:09C++26 in-place vector
- 25:35Block-based containers
- 33:30Deque vs vector of vectors
- 40:47Hive container
- 50:59List and forward_list
- 56:20Stack, queue, priority queue
- 1:00:24Associative containers memory
- 1:06:57Flat containers
- 1:14:33Vector 2.0 proposal
- 1:29:20Choosing containers in C++26
related talks
01h 00mOLD VERSION: The Fine Details Behind C++ Containers And Algorithms
58mRefresher on Containers, Algorithms and Performance
01h 00mThe Fine Details Behind C++ Containers And Algorithms
01h 00mMoving Faster: Everyday efficiency in modern C++
01h 01mRecipes for Reducing Allocations by C++ Containers
59mStrongly Typed Containers
13mMissing Optimizations on Node-based Containers
52mC++ Performance Tips - Cutting Down on Unnecessary Objects
