[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

perf: start the first workers in parallel, gate only the wide tail

Vladimir Sheremet (Jul 9, 2026, 10:19 AM +0200) 8f93c1b4 7d4bb6e4

+14 -6
+2 -2
.github/workflows/bench-adaptive.yml
··· 7 7 on: 8 8 pull_request: 9 9 paths: 10 - - '.github/workflows/bench-adaptive.yml' 11 - - 'scripts/bench-adaptive.mjs' 10 + - .github/workflows/bench-adaptive.yml 11 + - scripts/bench-adaptive.mjs 12 12 - 'packages/vitest/src/node/pools/**' 13 13 workflow_dispatch: 14 14
+12 -4
packages/vitest/src/node/pools/pool.ts
··· 288 288 return true 289 289 } 290 290 291 - // fresh workers ramp up by doubling (in-flight starts never exceed the 292 - // workers that already run) — the queue may no longer justify more 293 - // workers by the time the current batch is up, while a long queue still 294 - // reaches `maxWorkers` in logarithmic time instead of one by one 291 + // the first few workers are justified by any queue that reaches this 292 + // point — they start in parallel, which keeps small machines (CI 293 + // runners) at exactly the previous behavior; only the wide worker tail 294 + // of many-core machines is worth gating 295 + if (this.activeTasks.length < Math.min(this.maxWorkers, 4)) { 296 + return true 297 + } 298 + 299 + // beyond that, fresh workers ramp up by doubling (in-flight starts never 300 + // exceed the workers that already run) — the queue may no longer justify 301 + // more workers by the time the current batch is up, while a long queue 302 + // still reaches `maxWorkers` in logarithmic time instead of one by one 295 303 const startedWorkers = this.activeTasks.length - this._startingCount 296 304 if (this._startingCount >= Math.max(1, startedWorkers)) { 297 305 return false