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

cmd/compile: consider giving a warning or an error if a PGO profile looks mismatched #70291

Open
mvdan opened this issue Nov 11, 2024 · 4 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Thinking
Milestone

Comments

@mvdan
Copy link
Member

mvdan commented Nov 11, 2024

For example, if I run go build on a Go codebase with a default.pgo file, and the PGO logic can see that the majority of the symbols mentioned in the profile are not present in the source code at all, it could give a warning or an error to the user because one of two things might have happened:

  1. The profile was obtained for a different program with a fairly different codebase.
  2. The profile is old and the codebase has changed enough where the profile is no longer representative.

In both cases, it's possible that PGO may still give some minor benefit, but it's hard to say. Most importantly, I think we should surface this to the user so that they can grab a new profile.

(this idea came up during a brief PGO discussion at the Go contributor summit at golab.io)

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 11, 2024
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@seankhliao
Copy link
Member

cc @golang/compiler

@prattmic
Copy link
Member

Thanks for filing an issue. We've definitely discussed having some kind of profile staleness/match metric, though I can't find an existing issue for it.

@seankhliao
Copy link
Member

#65615 was a bad failure for a mismatched profile vs build. Maybe it should still fail but with a better error?

@cherrymui cherrymui added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Thinking labels Nov 12, 2024
@cherrymui cherrymui added this to the Backlog milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Thinking
Projects
Status: No status
Development

No branches or pull requests

6 participants