Repository navigation
Why is pool: 'forks' not default? #4914
|
From my very simple testing pool: 'forks' is slightly faster than the default pooling method. Initial run is like 500ms vs 300ms with pool: 'forks' for example. Why is it not the default? I also tested |
Replies: 4 comments 2 replies
|
Good question. We optimized |
|
Based on Tinypool's benchmarks Vitest's $ node isolate-benchmark.mjs
Options: { THREADS: 8, ROUNDS: 2000, IS_BUN: false }
Tinypool { runtime: 'worker_threads' } | START
Tinypool { runtime: 'worker_threads' } | END 10371 ms
Cooling down for 2s
................... ✓
Tinypool { runtime: 'child_process' } | START
Tinypool { runtime: 'child_process' } | END 12100 ms
Cooling down for 2s
................... ✓
Native node:worker_threads | START
Native node:worker_threads | END 9199 ms
Cooling down for 2s
................... ✓ |
|
+1 I have just switched from Mocha to Vitest. I had V8 FATAL errors using code that used node-postgres native and node-libcurl because of the current default. It took me a while to investigate how vitest runs tests and to find the argument '--pool=forks' what was I needed so if it's also faster, as well as 'safer' it ought to be the default. |
|
Maybe Vitest should indeed default to In the |

Good question. We optimized
forkspool in Vitest 1.0 and didn't look into performance differences yet, maybe it will be the default in the future.