Profile-guided optimization - The Go Programming Language
Starting in Go 1.20, the Go compiler supports profile-guided optimization (PGO) to further optimize builds. Table of Contents: Overview Collecting profiles Building with PGO Notes Frequently Asked Questions Appendix: alternative profile sources Profile-guided optimization (PGO), also known as feedback-directed optimization (FDO), is a compiler optimization technique that feeds information (a profile) from representative runs of the application back into to the compiler for the next build of the application, which uses that information to make more informed optimization decisions. For example, the compiler may decide to more aggressively inline functions which the profile indicates are called frequently. In Go, the compiler uses CPU pprof profiles as the input profile, such as from runtime/pprof or net/http/pprof. As of Go 1.22, benchmarks for a representative set of Go programs show that building with PGO improves performance by around 2-14%. We expect performance gains to generally in
Profile-guided optimization Starting in Go 1.20, the Go compiler supports profile-guided optimization (PGO) to further optimize builds. Table of Contents: Overview Collecting profiles Building with PGO Notes Frequently Asked Questions Appendix: alternative profile sources Overview Profile-guided optimization (PGO), also known as feedback-directed optimization (FDO), is a compiler optimization technique that feeds information (a profile) from representative runs of the application back into to the compiler for the next build of the application, which uses that information to make more informed
related reading
- Profiling Go programs with pprofjvns.ca
- Frequently Asked Questions (FAQ) - The Go Programming Languagego.dev
- Diagnostics - The Go Programming Languagego.dev
- Using go fix to modernize Go code - The Go Programming Languagego.dev
- Effective Go - The Go Programming Languagego.dev
- Go at Google: Language Design in the Service of Software Engineering - The Go Programming Languagego.dev
- Package names - The Go Programming Languagego.dev
- Notes on structured concurrency, or: Go statement considered harmful - njs blogvorpus.org
- GitHub - golang-standards/project-layout: Standard Go Project Layoutgithub.com
- The Go Programming Language Specification - The Go Programming Languagego.dev
- The Laws of Reflection - The Go Programming Languagego.dev
- The Go Memory Model - The Go Programming Languagego.dev