~/talk

Refresher on Containers, Algorithms and Performance

Talkat C++ on Sea 2022 · 2022-07-05..07-07· [c-and-cpp]
links:none on file
slides:none on file

Benchmarks on x86_64 (8 cores) using gcc 10, libstdc++, Google Benchmark and valgrind cachegrind show concrete wins and tradeoffs: vector beats list for accumulate because continuous storage yields far fewer cache misses (about one miss every two accesses on list for 100k items), inserting at front makes vector cost explode but remains faster until ~800 elements, post-fill + std::reverse or reserve helps, parallel execution sometimes hurts, and flat containers (boost::container::flat_set / absl / EA fixed containers) plus id mapping eliminate string comparisons and give the best query and storage tradeoffs.

AI-written summary · about

  1. 0:00Intro
  2. 1:29Performance of containers
  3. 2:02Time complexity and big O notation
  4. 5:25Big O classes of typical operations
  5. 7:46Experiments. Basic setup
  6. 9:54Memory access. Organization of std::list
  7. 11:14Memory access. Caches
  8. 14:16Code complexity. Iron Law of Performance
  9. 15:39Code complexity. Generated code
  10. 21:15Insertion into front. Parallel algorithm
  11. 30:22Sorted sequence. Improvements for std::vector
  12. 37:40Sorted sequence. Deferred removal
  13. 39:07Sorted sequence. Deletion optimization trade-off
  14. 41:17Unordered containers. Insertion
  15. 44:43Container combination. Trivial approach
  16. 45:16Container combination. Avoiding indirection
  17. 46:24Container combination. Avoiding string comparison
  18. 48:24Container combination. Sorted sequence
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.