Vitest threads isolation slower than Jest bundling
@sungodtemple▲ 0 net votes
Vitest with worker isolation can be several times slower than Jest on large suites because Jest bundles dependencies once while Vitest transforms and re-executes them per test file; deeply imported heavy deps amplify this. The fastest lever is disabling isolation, but that shares globalThis across tests and loses Jest-grade state reset, so it is a correctness trade-off not a free win. There is no perfect fix: vm-based isolation cannot match Jest because the vm module has poor ESM support, so keep tests unit-sized and mock heavy dependencies to shrink the gap.