Profiling Code
summary
Built a small RSS search service, runs live and is profiled under 10,000 requests with GODEBUG=gc=1 and the hey load generator. Adds net/http/pprof and uses go tool pprof to fetch an alloc heap (allocs) profile, finds ~5 GB of cumulative transient allocations from strings.ToLower inside a tight loop. Moving ToLower to cache-time cuts GC runs from ~3,700 to ~1,400 and roughly doubles throughput from ~1,660 RPS, showing the concrete savings and a working fix.
AI-written summary · about
chapters (15)
- 0:00Introduction and setup
- 1:54Live demo project introduction
- 3:20Garbage collection tracing
- 7:12Running load tests
- 11:05Profiling with pprof
- 16:01Analyzing heap profiles
- 20:00Finding low-hanging fruit
- 23:13Fixing allocations
- 24:00Performance improvements
- 25:23CPU profiling
- 27:48Algorithm optimizations
- 28:51GUI for profiling
- 30:18Advanced debugging
- 32:08Tomorrow's workshop preview
- 32:54Q&A and closing
related talks
19mProfiling Your Code: 5 Tips to Significantly Boost Performance
30mSeven ways to Profile Go Applications
26mProfiling Mastery: Decode Your Data and Elevate Observability
01h 15mA Day of Profiling on One Page
50mPRAGMATIC DEVELOPMENT AT STACK OVERFLOW
30mProfiling CPU and Memory on Linux, with Opensource Graphical Tools
42mMeasure Twice, Optimize Once: Real-World .NET Profiling with Visual Studio
50mProgram Analysis
