-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
x/tools/go/ssa: TestTypeparamTest slowed from < 1 second to > 25 seconds since CL 614975 #70078
Comments
Thanks for analyzing this. We should definitely make this test faster, reverting the CL if necessary. @xieyuschen There are about 300 single-file tests in the GOROOT/test/testparam directory. We should be running them in parallel. However, that alone won't make things faster because (I observe) the go list command executed by packages.Load is very highly contended: when run in parallel, many commands take over 7s to execute. When executed sequentially, the running time is clearly bimodal: usually it's around 70ms but often it is slightly more than 1.0s. @matloob @samthanawalla I vaguely recall that the go command, under some circumstances, deliberately sleeps for 1s to ensure a "happens before" relationship between file timestamps on file systems with very coarse mtime quantization (e.g. 1s on WSL). If we could somehow avoid that sleep, the parallel test would run in about 300 x 80ms / 16 cores = 1.5s. |
In other news: this test assumes that GOROOT/test is accessible, which is not the case for a downloaded toolchain. (The builders and most dev machines have a real GOROOT, which is why we didn't notice this till @pjweinb reported it today.) |
Change https://go.dev/cl/623135 mentions this issue: |
Thanks for your analysis:) @millerresearch
I don't know this part but looks like this optimization of
I have fixed this in the same CL for test Thanks! |
That would be a big benefit, especially for builders with slower filesystems. |
Go version
go version go1.22.5 linux/amd64
Output of
go env
in your module/workspace:What did you do?
In x/tools directory,
go test -short -count 1 -run TestTypeparamTest ./go/ssa
What did you see happen?
Since CL 614975 this test has slowed by more than 50x:
On plan9-arm, where the unfortunate migration to LUCI has made everything slower by splitting the goroot files and test execution onto separate machines across the network, the slowdown is more than 100x and causes the
x/tools
test to timeout and fail:What did you expect to see?
The comment at the head of function
TestTypeparamTest
says:However the code to do this seems to have been removed by CL 614975, making the comment incorrect and execution time very much slower.
The text was updated successfully, but these errors were encountered: