~/talk

Optimizing Go code without a blindfold

Talkat GopherCon Singapore 2019 · on Friday, 2019-05-03· [go]
slides:none on file

A tiny slice-copy change from append to prealloc plus index assignment yields about 70% faster and far fewer allocations, while a real JSON decoder benchmark runs ~10 ms per input (~200 MB/s) but bounces ±3–4% so a 1% win is lost in noise. Use benchstat to collect many samples and report variance, and use perflock to pin CPU clocks (example: run at 70% to avoid turbo throttling). Also watch out for multiple testing false positives.

AI-written summary · about

  1. 0:00Introduction to optimizing Go
  2. 2:07Benchmarking basics in Go
  3. 3:32Noise in benchmarks and statistics
  4. 7:28CPU throttling and pareflock
  5. 11:17Recap of tools and compiler tricks
  6. 13:05Compiler insights and escape analysis
  7. 15:36Code alignment and compiler improvements
  8. 17:47Compiler internals with SSA
  9. 18:37Q&A on benchmarking environments
~/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.