~/talk

Keynote: Benchmarking - It's About Time

Talkat C++Now 2026 · 2026-05-04..05-08· [web-performance]
slides:none on file

Live Linux clocks come from a kernel-provided VDSO so VDSO avoids syscalls and glibc often uses RDTSC/RDTSCP plus simple math to return nanoseconds; steady_clock now typically costs ~20–30 ns but a mistaken duration_max cast can read as zero. Compilers can remove or hoist work (volatile is insufficient) so use asm volatile + clobber memory or a benchmarking library; microbenchmarks need fences: RDTSC/RDTSCP + LFENCE changes measured times (examples: 111 ns vs 187 ns vs ~100 ns) and use Compiler Explorer, strace, gdb and perf to diagnose.

AI-written summary · about

  1. 0:00Introduction
  2. 1:23Measuring time in 1990s
  3. 4:30Why C++ for performance
  4. 6:14Worst benchmark summing
  5. 7:37Clock challenges in benchmarking
  6. 8:18Understanding std::chrono
  7. 13:51VDSO and seq locks optimize time
  8. 23:17Overhead of getting time
  9. 24:41Compiler tricks and discarded work
  10. 28:15Volatile not for benchmarking
  11. 31:44ASM keyword role
  12. 41:32Valid benchmark with ASM
  13. 48:11RDTSC and RDTSCP
  14. 54:26Testing custom clocks
  15. 57:53Fencing and out-of-order
  16. 1:03:06Branch prediction impact
  17. 1:08:36Real vs microbenchmarking
  18. 1:11:03Mitigating system noise
  19. 1:19:44Profiling tools
  20. 1:23:11Benchmarking challenges
  21. 1:27:02Q&A
~/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.