gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.08k stars 123 forks source link

Slow test execution on Apple M1 Pro & M2 chip #424

Closed ethicnology closed 2 months ago

ethicnology commented 3 months ago

We use gotestsum with my colleagues, and we noticed that the execution of tests is significantly slower (ten times slower) on Apple M2 compared to the traditional go test. For a series of tests running on the same host, I observed the following times:

Using gotestsum: 462.245s
Using go test: 44.12s
dnephin commented 2 months ago

Thank you for the bug report! I don't have any Apple machines that I can use to reproduce.

Can you confirm this is not an issue with other Apply machines? Is it specifically M1 pro and M2?

Can you send me the full command line you use to run gotestsum ? Maybe it's specific to one of the features?

Do you run tests with -count=1 in both cases? Does go test -json have similar runtime to gotestsum or go test ?

ethicnology commented 2 months ago

In my team we use these commands:

The flag -json has a similar runtime to go test, way faster than gotestsum. Currently, I'm using time go test -p 1 -count=1 -timeout 30m -json -v ./... | gotestfmt because of the speed problem, but I enjoy more the output of gotestsum and specially the sum.

I can't confirm for M1 and M2 Pro chips, but in our team I can confirm for M1 Pro and M2 in comparison to our GNU/linux coworkers.

dnephin commented 2 months ago

It may be related to the dots-v2 format. Do you see the same problem with the default format or testname format?

On Thu., Aug. 8, 2024, 10:34 ethicnology, @.***> wrote:

In my team we use these commands:

  • time go test -p 1 -count=1 -timeout 30m ./...
  • time gotestsum --format dots-v2 -- -p 1 -count=1 -timeout 30m ./...

The flag -json has a similar runtime to go test, way faster than gotestsum. Currently, I'm using time go test -p 1 -count=1 -timeout 30m -json -v ./... | gotestfmt because of the speed problem, but I enjoy more the output of gotestsum and specially the sum.

I can't confirm for M1 and M2 Pro chips, but in our team I can confirm for M1 Pro and M2 in comparison to our GNU/linux coworkers.

— Reply to this email directly, view it on GitHub https://github.com/gotestyourself/gotestsum/issues/424#issuecomment-2275987604, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADL6RGF5IWKIIRTYUVC3V3ZQN6XTAVCNFSM6AAAAABL2TVQD6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZVHE4DONRQGQ . You are receiving this because you commented.Message ID: @.***>

aaomidi commented 2 months ago

FWIW I've not seen this problem on my end.

ethicnology commented 2 months ago

Probably related to our environment then, thank you