Throwing Tools at Ranges
summary
Three implementations (C-style, C++17 algorithms, C++23 ranges) run through Google Benchmark, Cachegrind and the Visual Studio profiler on Windows/WSL with GCC 14. Initial benchmarks: C-style ~23s, C++17 ~33s, C++23 much slower because a cartesian-product view is evaluated twice. Fixing by materializing the shared range into a container removes duplicate evaluation, halves runtime and cache misses, and leaves the C++23 version slightly faster than the C-style code.
AI-written summary Β· about
chapters (10)
- 0:00Introduction and setup
- 2:27Development environment
- 4:02Code analysis methodology
- 7:51Implementing functional logic
- 23:00Google Benchmark overview
- 24:59Performance analysis with Cachegrind
- 35:52Visual Studio profiler demo
- 38:58Diagnosing lazy evaluation
- 44:22Code optimization results
- 51:31Conclusion and takeaways
related talks
01h 01mMoving to C++20 for Fun, Beauty... and Results!
01h 36mImplementing Ranges and Views in C++
01h 30mNew Algorithms in C++23
05m23 Ranges: slide & stride
59mHow to Implement the C++ Standard Library (Part 2): An Excursion into libc++
58mC++17 in Practice - The good and the ugly
01h 02mLatest & Greatest in Visual Studio for C++ developers
31mBringing C++ 17 Parallel Algorithms to a standard library near you
