~/talk

Compilers can be surprising

Talkat DotNext 2021 Moscow · 2021-10-21..10-22· [compilers-and-language-design]
links:none on file
slides:none on file

Claim: modern front-end and JIT back-end compilers are surprisingly fragile and can turn tiny source changes into huge performance swings. Demos use SharpLab, a custom Visual Studio decompiler and WinDbg; examples show reordered multiplies producing a 20× difference, bounds-check removal via loop cloning after copying arrays to locals, span slices required to avoid hidden checks, and a throw helper pattern (void function whose only exit throws) to keep exception setup off the hot path. Reported gains: ~50% from local copies, 2–3× for compound ops, 10–20× for struct virtualization fixes; .NET 6 fixes some but not all.

AI-written summary · about

  1. 0:00Introduction
  2. 1:34Why compilers surprise us
  3. 2:58Compiler basics and JIT
  4. 8:18JIT compilation steps
  5. 12:32Breaking compilers with demos
  6. 13:34Assembly code primer
  7. 14:36Multiplication order demo
  8. 17:44If statement surprises
  9. 23:25Throw helper optimization
  10. 26:56Switch case optimizations
  11. 32:12Loop performance traps
  12. 39:38Precomputation and hoisting
  13. 41:42Span optimizations
  14. 44:11Struct and interface quirks
  15. 52:15Performance gains summary
  16. 53:40Does .NET 6 fix it all?
  17. 55:05Q&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.