Go Performance & Optimization Training
Unlock the full performance potential of Go with this intensive 2-day training. Learn to profile, benchmark, and optimize Go applications using the tools built into the Go ecosystem, from CPU and memory profiling to garbage collector tuning and compiler optimizations.
Training Details
Section titled “Training Details”| Duration | 2 days (16 hours) |
| Level | Advanced |
| Delivery | In-person, Live online, Hybrid |
| Certification | N/A |
Who Is This For?
Section titled “Who Is This For?”- Senior Go developers optimizing production services
- Performance engineers working with Go applications
- Backend engineers troubleshooting latency and memory issues
- Technical leads setting performance standards for Go projects
Learning Outcomes
Section titled “Learning Outcomes”After completing this training, participants will be able to:
- Profile Go applications using pprof (CPU, memory, goroutine, block)
- Write and interpret benchmarks with testing.B
- Optimize memory allocations and reduce GC pressure
- Tune the garbage collector for specific workloads
- Apply escape analysis to understand heap vs stack allocation
- Identify and eliminate performance bottlenecks in production code
Detailed Agenda
Section titled “Detailed Agenda”Day 1: Profiling and Benchmarking
Section titled “Day 1: Profiling and Benchmarking”Module 1: Benchmarking with testing.B
- Writing benchmarks and sub-benchmarks
- Benchmark flags (-benchtime, -benchmem, -count)
- Comparing benchmarks with benchstat
- Avoiding common benchmarking pitfalls
- Hands-on: Benchmark a data processing library
Module 2: CPU Profiling
- pprof CPU profiling (runtime/pprof and net/http/pprof)
- Reading flame graphs and call graphs
- Identifying hot paths and CPU-bound bottlenecks
- go tool pprof interactive analysis
- Hands-on: Profile and optimize a CPU-bound service
Module 3: Memory Profiling
- Heap profiling and allocation tracking
- Inuse vs alloc memory profiles
- Identifying memory leaks
- Object allocation patterns
- Hands-on: Find and fix memory leaks in a long-running service
Day 2: Optimization Techniques
Section titled “Day 2: Optimization Techniques”Module 4: Escape Analysis and Allocation
- Stack vs heap allocation in Go
- Escape analysis with -gcflags=“-m”
- Reducing allocations with sync.Pool
- Value vs pointer semantics for performance
- Hands-on: Optimize allocation-heavy code paths
Module 5: Garbage Collector Tuning
- Go GC internals (tri-color mark and sweep)
- GOGC and GOMEMLIMIT settings
- GC pacer and latency impact
- Monitoring GC with runtime/metrics
- Hands-on: Tune GC for a latency-sensitive service
Module 6: Advanced Optimization
- String and byte slice optimization
- Map and slice pre-allocation
- Interface call overhead and devirtualization
- Compiler optimizations and inlining
- Concurrent data structure design
- Hands-on: Capstone — optimize a real-world Go service for throughput and latency
Prerequisites
Section titled “Prerequisites”- Strong Go development experience
- Understanding of Go concurrency (goroutines, channels)
- Familiarity with Go toolchain and testing
- Basic understanding of computer architecture (CPU cache, memory hierarchy) is helpful
Delivery Formats
Section titled “Delivery Formats”| Format | Description |
|---|---|
| In-Person | On-site at your company’s location, hands-on with direct interaction |
| Live Online | Interactive virtual sessions with screen sharing and real-time labs |
| Hybrid | Combination of on-site and remote sessions, flexible scheduling |
All formats include hands-on labs, course materials, profiling cheat sheets, and post-training support.