Company
Date Published
Author
Felix Geisendörfer
Word count
1392
Language
English
Hacker News points
1

Summary

We've released Datadog's PGO (Profile Guided Optimization) tooling for Go, which can reduce CPU usage by up to 14% by adding a single line of code before the `go build` command. The tool downloads representative CPU profiles from production and merges them into a default.pgo file, which is used to generate better machine code that optimizes function calls. We tested this on a large internal Go service, which showed a 5.4% reduction in CPU time compared to the baseline. Although the impact was more pronounced with a larger service, smaller services can still benefit from PGO by saving even a few percent of compute per host, leading to cost savings and better service latency. Further testing revealed an unexpected problem with goroutine stack size, but we've implemented a temporary mitigation in our tooling and submitted an upstream proposal for a new goroutine stack profiler to the Go project.