~/talk

Practical Memory Profiling

Talkat GopherCon Europe 2022 · 2022-07-28..07-31· [go]
slides:none on file

Benchmark compares two algorithms: original is ~1100 ns/op with 53 bytes and 2 allocations, rival is ~4× faster with zero allocations. Use go test -bench to measure, write memory profile and inspect with go tool pprof, then run the compiler escape report via -gcflags -m=2 to see why values escape. Fixes remove interface-induced allocations and supply constant slice sizes so profile drops to 1 alloc of 5 bytes and then to zero, while CPU gap narrows to a few hundred nanoseconds.

AI-written summary · about

  1. 0:00Start
  2. 0:43Two Truths and One Lie
  3. 6:57Zero Allocation Algorithm
  4. 14:17Ownership Rule
~/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.