~/talk

C++ Coroutines from scratch

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [frontend-architecture]
slides:none on file

Shows a concrete migration from a lambda‑continuation loader to C++20 coroutines that replaces manual batching with coroutine suspension. Code uses a promise type, coroutine_handle and promise type, and custom awaiters to hold dependency state on the coroutine frame. A synthetic 10 ms per-file latency example loads 10 transitive objects, collapsing 10→3 round trips and cutting runtime from ~123ms→38ms. The loader is implemented over JSON deserialization and the coroutine version reduces allocations and simplifies lifetime handling.

AI-written summary · about

  1. 0:00C++ coroutines intro
  2. 3:51Real-world problem scenario
  3. 9:10Naive object loading
  4. 15:51Performance bottlenecks
  5. 17:58Batch loading optimization
  6. 28:20Coroutine architecture
  7. 36:43Promise type methods
  8. 44:26Build task coroutines
  9. 53:24Final coroutine benefits
  10. 57:43Key differences from lambda-based approach
  11. 1:00:13C++20 generators & closing
~/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.