-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
tests run 3x slower than Jest #229
Comments
Profiled this issue. Most of the time is spent in @antfu Shouldn't default |
Did you try if externalizing |
All three options did not work. I would assume that |
I did some logging in vitest/packages/vitest/src/node/execute.ts Line 273 in 149c123
And it's externalized without having to set anything in the config. |
@antfu I have finally found it!: With this it takes ~4s, without these lines ~700ms. |
Oh interesting and nice finding! I think we could introduce an option to disable it. /cc @patak-dev |
If it helps, I've added vitest to my benchmarking repo here which has a collections of unit tests which run against jasmine, jest and vitest. In my benchmarks, I'm seeing vitest perform about 2x slower than Jest and nearly 4x slower than Jasmine. |
@antfu Can I work on this? |
Ok. I see it is already done 🙂 |
@sachinraja Tests are taking ~800ms now. |
Vitest v0.0.100 (your branch)
Vitest v0.0.123
|
I re-ran my benchmarks with vitest@0.0.123 & vite@27.10 and found some strange results. Here's Jest as our baseline (17.702s avg):
Here's Vitest with default configuration settings (41.493s avg):
Here's Vitest with
Is it expected that multithreaded execution would be 4x slower? I'm on a Quad-Core Intel Core i5. Overall, this is really amazing news! Vitest is faster than Jasmine which is considered fastest in all test runner benchmarks I've seen. This is a huge achievement! |
I saw that threads are slower too. Alter checking it with nodejs profiler I can see that workers are idling a lot. |
Describe the bug
Tests run 3x slower than Jest for me.
Reproduction
vitest: https://github.com/sachinraja/zod-to-ts/tree/vitest
jest: https://github.com/sachinraja/zod-to-ts/tree/main
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: