testing: high start up cost with high -count and no tests #49050
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Performance
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 a benchmark many, many times. (The intention here is to run benchmarks for hours)
https://play.golang.org/p/tKSzmTOK_-m
go test -bench=. -count=10000000
What did you expect to see?
Benchmarks start running immediately.
What did you see instead?
Nothing seems to happen for ~30s before the benchmarks start running. The issue appears to be that
runTests
runs its count loop 10000000 times, even though there are no tests to run.One quick fix may be for
runTests
to exit immediately iflen(tests) == 0
, though I've distilled this issue down from my initial problem of a long time waiting for benchmarks to start in a package that has tests which I skip with-run=none
. It would be nice to fix that case too. For that, perhaps the first pass throughrunTests
records if it ran any tests. If not, the next iteration immediately breaks.The text was updated successfully, but these errors were encountered: