Using the Go profiler (pprof). Profile via net/http/pprof, CPU profile (collects data for 30 seconds), Heap memory (returns current memory info).