Skip to Content
Skip to content
Tutorials

Programming Tutorials

Standalone programming tutorials for solving one specific problem at a time. Each guide starts with the exact error message, failing behavior, or design constraint, gives you a minimal reproducible script or query, and walks through the fix with real output.

Pick a language below or filter by topic and difficulty when you need a quick, practical reference you can test locally and apply right away.

Go
Reuse Buffers Without Corrupting Data Using sync.Pool Level: Advanced

Cut per-request allocations with sync.Pool without leaking stale bytes across requests or holding onto oversized buffers forever.

Go
Find CPU and Heap Hotspots in Go With pprof Level: Advanced

Capture CPU and heap profiles from a Go test or net/http/pprof endpoint, read flat vs cum in go tool pprof -top, and verify that a fix actually reduced allocations.

Go
Read Go Escape Analysis (-gcflags=-m) and Tune GOMEMLIMIT Level: Advanced

Inspect heap escapes with go build -gcflags=-m and set GOGC and GOMEMLIMIT to prevent container OOM kills. After this, memory usage and GC behavior are predictable in production.

Go
Diagnose Scheduler and Lock Contention With go tool trace and Mutex Profiles Level: Advanced

Capture -mutexprofile and -trace outputs from Go benchmarks to pinpoint lock contention and scheduler stalls. After this, you spot hidden blocking waits that CPU profiles miss.