Skip to content

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

Open
@mvdan

Description

@mvdan

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Thinkingcompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions