~/talk

Throwing Tools at C++ Ranges

Talkat C++ on Sea 2023 · 2023-06-28..06-30· [c-and-cpp]
slides:none on file

Compares three implementations (manual C style, C++17 algorithms, C++23 ranges via range-v3) using Google Benchmark, Cachegrind and the Visual Studio CPU profiler on WSL/Windows; measures runtime, instruction/data refs, cache misses and branch stats. Finds an initial C++23 version ~10x slower because a Cartesian product evaluated twice across lazy views; fixing by materializing the product (materialize with ranges::to vector) removes duplicated work and makes C++23 as fast or faster than C style. Also shows simple loop fusion to remove temporaries improves cache behavior and runtime.

AI-written summary · about

  1. 0:00Performance analysis with C++ ranges
  2. 2:17Profiling tools setup
  3. 4:50Analyzing example code
  4. 8:43C++17 vs C-style comparison
  5. 19:59Cachegrind for cache efficiency
  6. 30:47Live demo with VS Profiler
  7. 35:23Optimizing C-style version
  8. 39:19Optimizing C++17 with accumulate
  9. 40:48Debug profiling with Range V3
  10. 45:30Fixing double evaluation
  11. 47:19Post-optimization re-evaluation
  12. 51:13Final performance comparison
~/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.