In a 2018 keynote, Rick Hudson traces how Go cut the time it paused programs to reclaim memory. Measurements from one Twitter production server went from roughly 300–400 milliseconds to under a millisecond over several releases. The team got there by doing more work while the program ran and removing the remaining expensive steps from the pause.

  • Measure the whole session. If each of 100 independent requests has a 1% chance of running slowly, about 37% of sessions get through all 100 without a slow request.
  • Make allocation help pay for collection. When new allocations outpace the collector, Go’s pacing code assigns some of the marking work to the goroutines that are allocating memory.
  • Test changes on the programs that will pay for them. Two experimental collectors looked good on some workloads. Both added bookkeeping to pointer writes between collections, and the broader benchmarks exposed the cost.

A shorter pause can mean the work moved somewhere else. Measure application throughput and memory use alongside pause times before deciding whether the change helped.