“How to Choose the Right Standard Library Container, and Why You Should Want Some More”
summary
Three concrete case studies compare list, vector, deque, a homegrown shifty vector, and colony on real tests (10k widgets, queue ≈10). Visual Studio 2017 profiling shows list is slow due to allocations; vector cuts time ~3.5× and memory ~5× with reserve; deque halves time but raises memory ~3×; shifty vector is ~2.5× faster than deque and ~4.5× faster than vector with vector-like memory; colony yields ~5× speedup and slightly lower footprint. Recycling vectors (move+clear into a pool) fixes capacity thrash and speeds one simulation ~12× (435 → 35 min), measured with Windows peak-commit and a profiler.
AI-written summary · about
chapters (27)
- 0:00Introduction
- 1:00A Tale of Letters
- 5:05Containers
- 11:57How does it work
- 13:33Deck
- 15:29Shifty Vector
- 20:41Fixed Capacity
- 27:09The Colony
- 28:42The Container
- 29:51Where were we
- 32:40What happens in a vector
- 36:22A simple approach
- 38:42A real world example
- 39:25Dont make assumptions
- 43:00How to measure memory
- 43:54Did you try to use allocators
- 44:53Are there good quality implementations
- 46:07Associative containers
- 47:10Tools to investigate containers
- 48:34The way it would work
- 50:11Timesteps
- 53:14Memory
- 54:10ShiftyVector
- 55:26Vector Size
- 56:13Element Size
- 58:02Block Size
- 59:35STD
related talks
05mChoose proper container... automatically?
59mStrongly Typed Containers
37mEnhancing STL containers
56m“High Performance Code 201: Hybrid Data Structures"
47mUnderstanding And Mastering Flat Containers
36mInterfaces Matter
51mKeynote: There Is No Silver Bullet to Solve All C++ Software Problems
01h 00m“State Machines Battlefield - Naive vs STL vs Boost”
