~/talk

Printf Debugging at 1ns: High-Performance C++ Logging Without Locks

Talkat ACCU 2025 · 2025-04-01..04-04· [c-and-cpp]
name:Greg Law
linkedin:gregthelaw
slides:none on file

Claims a lock-free, system-call-free C++ logger (L3) that records entries at 1 nanosecond per entry by using an atomically incremented index into an mmap-backed lock-free buffer and writing pointer-sized descriptors instead of formatted strings. Logs scale across cores without mutex contention, recover original text by post-processing RO data section offsets to map pointers back to strings, and a single-thread fast-path saves roughly 10 ns. Full source and docs on GitHub.

AI-written summary · about

  1. 0:00Why printf debugging is problematic
  2. 0:36Limitations of standard printf and fprintf
  3. 1:16Performance bottlenecks in multithreaded logging
  4. 1:59Exploring alternatives: speedlog and sprintf
  5. 2:30Designing a lock-free logging buffer
  6. 3:10Using mmap to eliminate system calls
  7. 3:50Optimizing further: pointer-based logging
  8. 4:36Post-processing logs from RO data sections
  9. 5:00Final thoughts and future improvements
~/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.