Using STL containers efficiently
summary
Practical recipes for faster STL use: avoid needless copies by preferring pass-by-reference and implementing a copy-on-write with atomic refcount for large returnable objects; prefer contiguous storage (vector) and implement erase-by-swap (copy last element over deleted slot then pop_back) instead of middle erases; avoid deep copies while holding locks by swapping with a dummy vector; instrument std::map in huge codebases (100 million LOC) to find hot keys and replace repeated lookups with a single-entry cache for huge speedups.
AI-written summary · about
chapters (5)
related talks
48mC++ Data Structures That Make Video Games Go Round
01h 04mBack to Basics: Standard Library Containers in Cpp
24mDesigning Fast and Efficient List-like Data Structures
55mIntroduction to C++ Containers - Know Your Data Structures
01h 13mC++ Memory Model Meets High-Update-Rate Data Structures
45mBeyond Lists: High Performance Data Structures
01h 01mSmarter Cpp Atomic Smart Pointers - Efficient Concurrent Memory Management
01h 05mImplementing Understandable World Class Hash Tables in C++
