Running Away From Computation - An Introduction
summary
Shows concrete techniques and measured effects: adding a tail pointer to a singly linked list drops append time from ~14.5s to ~0.01s for 100k inserts (~1,450× speedup), short‑circuiting and caching avoid repeated work, and constexpr with static_assert moves computations into compilation so the binary contains precomputed tables instead of runtime loops (assembly size shrinks). Demonstrates lazy evaluation via std::async launch::deferred and copy‑on‑write, uses the perf profiler for timings, and makes code available for verification.
AI-written summary · about
chapters (23)
- 0:00Intro
- 2:18What you're going to learn today
- 4:21Trade-off: Time versus Space!
- 5:21Linked List Experiment 1 (3/3)
- 7:20is way faster than LL1
- 9:12Recap (1/2)
- 12:29Stages of a C++ Program
- 13:17Compile-Time versus Run-time (3/3)
- 14:14Run-time Optimization is fun and... (1/2)
- 15:29Use a better algorithm (for your use case)
- 17:12Do Less Work
- 20:51Hand tune optimizations Dead Code Elimination
- 25:37Better Algorithms, Better Data Structures (2/3)
- 28:06Delay/Stall - Promise/Future (1/2)
- 31:21Copy on Write (Cow)
- 32:41Run-time computation Strategies (1/3)
- 34:32Compile-Time Computation
- 35:00Let the Compiler Optimize (-02) - Dead Code Elimination
- 36:09Strategy 2-Question to Audience
- 39:37Use static_assert when possible [Core Guideline] (1/2)
- 42:29constexpr [cppreference] - factorial (1/3)
- 44:09Static Data (1/2)
- 46:37Template Metaprogramming
