Become a 10x Developer with Go Performance Optimization
summary
Covers concrete Go techniques: go tool pprof and HTTP /debug/pprof for CPU/heap profiles, the trace tool and flight recorder (GA in Go 1.25), and the hey load tester for HTTP1/2 with -n/-c/-cpus flags. Shows benchmark practice: Perflock to reduce noise, benchstat with p=0.002, and Go 1.24’s B.loop change. Demo fixes a CVE where strings.Split causes ~1.63 GB allocations and 170k ns/op; replacing with string cuts drops allocations dramatically and latency to ~112 ns/op, increasing throughput and removing the large allocation hotspot.
AI-written summary · about
