vitest: tests run 3x slower than Jest
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
System:
OS: Linux 5.15 Pop!_OS 21.10
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Memory: 5.03 GB / 15.44 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.11.1 - ~/.asdf/installs/nodejs/16.11.1/bin/node
Yarn: 1.22.15 - ~/.asdf/installs/nodejs/16.11.1/.npm/bin/yarn
npm: 8.0.0 - ~/.asdf/plugins/nodejs/shims/npm
Browsers:
Brave Browser: 96.1.33.106
Firefox: 95.0
npmPackages:
vite: 2.7.4 => 2.7.4
vitest: 0.0.100 => 0.0.100
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (15 by maintainers)
@sachinraja Tests are taking ~800ms now. And with threads disabled ~650ms.
I saw that threads are slower too. Alter checking it with nodejs profiler I can see that workers are idling a lot. Will investigate where bottleneck is.
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.
Profiled this issue. Most of the time is spent in
vite
doTransform
. The biggest bar it transformingtypescript
. It is a dependency of zod-to-ts.@antfu Shouldn’t default
deps.external
option preventvitest
from transforming stuff innode_modules
?