Describe the bug
After upgrading from Vitest v3 to v4, I’m seeing a consistent ~2× slowdown in our test suite when running with a single worker thread.
Prior behavior (v3)
Using the following config:
export default defineConfig({
test: {
globals: true,
environment: 'node',
pool: 'threads',
poolOptions: { threads: { singleThread: true } },
},
})
Execution time:
Duration 846ms
(transform 137ms, setup 0ms, collect 153ms, tests 9ms, environment 0ms, prepare 193ms)
After upgrade (v4)
Updated config per migration guide, replacing deprecated poolOptions:
export default defineConfig({
test: {
globals: true,
environment: 'node',
pool: 'threads',
maxWorkers: 1,
},
})
Execution time:
Duration 1.79s
(transform 122ms, setup 0ms, collect 193ms, tests 15ms, environment 0ms, prepare 35ms)
Observations
- Test execution time is nearly doubled from 846ms to 1.79s. (results from the minimal reproductions on StackBlitz)
- On my main project, I have almost the same difference (from 54s to 138s)
Thanks for vitest, it is awesome 😊
Reproduction
System Info
System:
OS: macOS 15.6.1
CPU: (12) arm64 Apple M3 Pro
Memory: 405.28 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.18.0 - /Users/benjamin_petetot/.local/share/mise/installs/node/22.18.0/bin/node
npm: 10.9.3 - /Users/benjamin_petetot/.local/share/mise/installs/node/22.18.0/bin/npm
pnpm: 10.18.3 - /opt/homebrew/bin/pnpm
Watchman: 2025.10.13.00 - /opt/homebrew/bin/watchman
Browsers:
Brave Browser: 141.1.83.118
Chrome: 139.0.7258.155
Firefox: 137.0
Safari: 18.6
npmPackages:
vitest: ^4.0.3 => 4.0.3
Used Package Manager
npm
Validations
Describe the bug
After upgrading from Vitest v3 to v4, I’m seeing a consistent ~2× slowdown in our test suite when running with a single worker thread.
Prior behavior (v3)
Using the following config:
Execution time:
After upgrade (v4)
Updated config per migration guide, replacing deprecated poolOptions:
Execution time:
Observations
Thanks for vitest, it is awesome 😊
Reproduction
Reproduction Vitest v3 (before): https://stackblitz.com/edit/vitest-dev-vitest-dh3lzrnu?file=vite.config.ts
Reproduction Vitest v4 (after): https://stackblitz.com/edit/vitest-dev-vitest-b2yoehcc?file=vite.config.ts
System Info
System: OS: macOS 15.6.1 CPU: (12) arm64 Apple M3 Pro Memory: 405.28 MB / 18.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.18.0 - /Users/benjamin_petetot/.local/share/mise/installs/node/22.18.0/bin/node npm: 10.9.3 - /Users/benjamin_petetot/.local/share/mise/installs/node/22.18.0/bin/npm pnpm: 10.18.3 - /opt/homebrew/bin/pnpm Watchman: 2025.10.13.00 - /opt/homebrew/bin/watchman Browsers: Brave Browser: 141.1.83.118 Chrome: 139.0.7258.155 Firefox: 137.0 Safari: 18.6 npmPackages: vitest: ^4.0.3 => 4.0.3Used Package Manager
npm
Validations