~/talk

What C and C++ can do and when do you need Assembly?

links:none on file
slides:none on file

Shows generated code from GCC and Clang using Compiler Explorer and llvm-mca and compares actual x86-64 microops, latencies and timelines; replacing large switch-based HTTP state machines with goto labels yields 2x speedup on a 900-state parser by cutting branch misses and cache pressure; Spectre and page-table mitigations impose about 15%–30% cost; SLP/vectorization rarely helps the HTTP parser so math/crypto stays in hand-written assembly for multi-limb big-int speedups; user-space spinlocks can cause ~100 ms wake latencies.

AI-written summary · about

  1. 0:00Start
  2. 1:01What C and C++ can do and when do you need Assembly
  3. 9:35(x86-64) Code execution
  4. 11:45Intelpocalypse: performance cost
  5. 12:14Code review: "is the compiler smart enough?"
  6. 15:02GCC switch optimization: lookup table
  7. 15:53GCC switch optimization: binary search
  8. 17:35Direct jumps vs switch: performance
  9. 19:12GCC labeled code reordering
  10. 20:46Compiler barrier
  11. 25:12SIMD optimizations
  12. 26:18SIMD in the Linux kernel
  13. 39:45Mixing AVX code with SSE code
  14. 41:11Easy assembly
  15. 42:24Spinlocks & huge tail latencies
~/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.