-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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/go/internal/test: default pgo=auto results in surprising slow behaviour #61983
Comments
CC @bcmills, @cherrymui. |
(this could be WAI if the intent here is that |
The documentation for the
I agree that if no test program is actually being built for |
@cherrymui, do you have the bandwidth to write a fix for this? |
In triage, @thanm pointed out that it's probably |
@cherrymui suggests that maybe @aclements suggests that the Go command could recognize that there are no test files and that it's only building the target for vet, and turn off PGO for that target. |
No difference, extremely long "rebuild the world" pause with
|
Sorry for the delay. @lizthegrey could you try if CL https://go.dev/cl/531796 helps reduce the testing time? Thanks! |
Change https://go.dev/cl/531796 mentions this issue: |
I'll have to build a go binary with gotip, it'll take me a few days to get to this. |
@lizthegrey that CL should apply cleanly to Go 1.21 release branch, if that helps. Thanks. |
Verified working. It quickly shows |
Friendly nudge, now that we are four weeks away from the 1.23 freeze :) Bryan gave a review on the patch back in November, and he's left the team at this point, but hopefully we should still be able to finish the review. cc @matloob @samthanawalla per https://dev.golang.org/owners. |
Please confirm you don't need me to further test any patches, and that this is just a matter of review and merging. |
Not at the moment. Thanks. CL 531796 should fix the issue. But according to Bryan's comment this may not be the right approach. I'll look into it and see if there is a better approach. Thanks. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run
go test ./...
where one directory (which has no tests in it) contains adefault.pgo
file, but a subdirectory contains tests. eg:What did you expect to see?
Build should be fast because all intermediate build artifacts are reused since no
*_test.go
files are directly located in a directory containingdefault.pgo
What did you see instead?
A custom build was done for
cmd/app
withdefault.pgo
in use (even if no tests were found for that directory), forcing recompilation of everything to ensure complete optimization.However, running with pgo explicitly turned off does proceed quickly:
The text was updated successfully, but these errors were encountered: