~/talk

C++ Coroutines From Scratch

Talkat ACCU 2023 · 2023-04-19..04-22· [c-and-cpp]
slides:none on file

An object-deserialization pipeline gets rewritten from recursive, callback-heavy code into a coroutine-driven batch loader that drops 10 network round-trips to about 3 and cuts runtime from ~123 ms to ~36 ms (≈3x faster). It uses C++20 coroutines with promise types living in the coroutine frame, co_await/co_yield to suspend/resume, and a generator-style interface (std::generator planned in C++23). The code removes manual continuation lambdas and extra allocations but requires passing coroutine arguments by value to avoid dangling references.

AI-written summary · about

  1. 0:00Introduction
  2. 2:52Coroutines learning curve
  3. 6:03Quant library deserialization
  4. 11:55Depth-first deserialization
  5. 16:12Deserialization bottlenecks
  6. 18:47Breadth-first deserialization
  7. 31:11C++ coroutines
  8. 48:29Coroutines for deserialization
  9. 1:07:56std::generator and summary
~/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.