-
Notifications
You must be signed in to change notification settings - Fork 3.9k
build: use profile-guided optimization #110262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Go 1.22 is expanding PGO's capabilities:
|
I read more about pgo its very interesting - the hard part is it needs a pprof to guide the optimization, do you have guidances on how get a proper profile? bazel already support pgo, once i get profile i can drop into the folder that contains the main.go, and add |
Hi @lyang24, in Note that building with PGO is substantially slower than building without it. It also has implications for caching with respect to the build especially if you are doing development, running tests, etc. |
When this gets tackled we'll also want to include a sysbench profile. (I'm happy to provide one, just DM me). |
Some updates since none of this pinged back to this issue (I think it was all tracked under https://cockroachlabs.atlassian.net/browse/CRDB-44692, which is not linked to Github): There have been numerous PRs for collecting profiles from our nightly roachtest runs: pgo support for bazel (i.e. ability to plug in cpu profiles for pgo in release builds) was added here but then reverted due to OOM issues on the builder machines: |
I tested on this build shared by @rickystewart . The profile used for pgo is from the following roachtests: kv0/enc=false/nodes=3,kv95/enc=false/nodes=3,tpccbench/nodes=3/cpu=16 The results were that there wasn't a discernable change on the sysbench reference workload. This is surprising, so we should evaluate it again, perhaps on a pgo build based solely on a profile from oltp_read_write.
|
We updated the profile-generation logic as well as the profile itself. Sysbench results using this profile show reasonable improvements in the 1-2% range:
This is not as big of an improvement as we would have hoped, but we can make improvements to the profile over time. That will be done as follow-up work. We also expect the Go compiler to get "smarter" about applying PGO-specific optimizations with new releases. |
Go 1.20 (https://tip.golang.org/doc/go1.20) added support for profile-guided optimization (PGO). Go 1.21 (https://tip.golang.org/doc/go1.21) further improves PGO and marks it as ready for general use.
PGO promises to improve the performance of Go programs:
PGO currently achieves this by inline hot function calls, but the Go team expects it to become more capable in future releases: golang/go#62463.
Once #109773 lands, we should test out PGO and explore integrating it into our CI pipeline.
Jira issue: CRDB-31351
Epic CRDB-41952
The text was updated successfully, but these errors were encountered: