~/talk

Optimizing Go code without a blindfold

Talkat dotGo 2019 · on Monday, 2019-03-25· [go, testing]
slides:none on file

A collection of concrete lessons and numbers: a naive slice copy reduces from 10 allocations to one and becomes 70% faster when preallocated; a JSON decode benchmark sits at ~10 ms per run with ~3% variance that drops to ~1% after killing noisy apps; statistical testing yields false 1% gains after repeated runs; use benchstat for variance and a CPU‑pinning tool like perlock to avoid thermal throttling and flakey results.

AI-written summary · about

  1. 0:00Intro
  2. 0:21Is your program slow?
  3. 1:07This is a silly example.
  4. 2:30Benchmark demands 100%.
  5. 3:19However, the CPU burns.
  6. 3:44Air vents measuring 2 gopher feet.
  7. 6:18Multiple testing problem!
  8. 7:19don't get new data!
  9. 8:19benchstat to compare statistics. perflock to avoid noise.
  10. 12:07GOSSAFUNC=pattern go build
~/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.