Skip to content
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

Provide pgo file during compilation #2724

Merged
merged 1 commit into from
Feb 11, 2024
Merged

Provide pgo file during compilation #2724

merged 1 commit into from
Feb 11, 2024

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Feb 10, 2024

Why this should be merged

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.

How this works

PGO is "ready for general use" as of go1.21. This adds a CPU profile from a validator into the default pgo location.

Also, it is expected to commit these profiles to the source tree:

Committing profiles directly in the source repository is recommended as profiles are an input to the build important for reproducible (and performant!) builds. Storing alongside the source simplifies the build experience as there are no additional steps to get the profile beyond fetching the source.

How this was tested

  • Made sure the compiler was picking up the location of the file by testing with an invalid profile.
  • CI

@StephenButtolph StephenButtolph added the ci This focuses on changes to the CI process label Feb 10, 2024
@StephenButtolph StephenButtolph added this to the v1.11.0 milestone Feb 10, 2024
@StephenButtolph StephenButtolph self-assigned this Feb 10, 2024
@StephenButtolph
Copy link
Contributor Author

Note: updating this file should be added as part of the version bump PR from now on.

@StephenButtolph StephenButtolph added this pull request to the merge queue Feb 11, 2024
@StephenButtolph StephenButtolph removed this pull request from the merge queue due to a manual request Feb 11, 2024
@StephenButtolph StephenButtolph added this pull request to the merge queue Feb 11, 2024
Merged via the queue into master with commit a7293ac Feb 11, 2024
17 checks passed
@StephenButtolph StephenButtolph deleted the build-with-pgo branch February 11, 2024 01:22
mboben pushed a commit to mboben/avalanchego that referenced this pull request Apr 7, 2024
Co-authored-by: Chloe <99216251+coffeeavax@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants