~/talk

Profiling real-world golang service

Talkat Golang Piter 2019 · on Friday, 2019-11-01· [go]
links:none on file
slides:none on file

Profiles a production Go ad-serving service with pprof CPU+heap and benchmark-driven profiles, finds JSON marshaling as the CPU hotspot and replaces the stdlib encoder with a faster library giving ~4x faster marshaling in benchmarks and removing it from top CPU lists. Changes string-key maps to packed 64-bit integer keys, cutting a 1M-entry map from 442MB to 300MB and saving ~1.5GB at 50M entries, lowering GC STW from ~12ms to ~7ms. Also swaps net/http for a zero-allocation client, reduces allocations ~7x, and meets peak load without buying servers.

AI-written summary · about

  1. 0:00Introduction
  2. 6:07Performance issues
  3. 10:02Profiling in Go
  4. 17:04Memory optimization
  5. 24:31HTTP client allocations
  6. 30:54Summary
~/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.