[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: limit workspace project concurrency to available cores (#6869)

authored by

Vladimir and committed by
GitHub
(Nov 7, 2024, 12:45 PM +0100) f4c04ab6 b21cdcec

+2 -1
+2 -1
packages/vitest/src/node/workspace/resolveWorkspace.ts
··· 2 2 import type { UserConfig, UserWorkspaceConfig, WorkspaceProjectConfiguration } from '../types/config' 3 3 import type { WorkspaceProject } from '../workspace' 4 4 import { existsSync, promises as fs } from 'node:fs' 5 + import os from 'node:os' 5 6 import { limitConcurrency } from '@vitest/runner/utils' 6 7 import fg from 'fast-glob' 7 8 import { relative, resolve } from 'pathe' ··· 51 52 52 53 const projectPromises: Promise<WorkspaceProject>[] = [] 53 54 const fileProjects = [...configFiles, ...nonConfigDirectories] 54 - const concurrent = limitConcurrency(5) 55 + const concurrent = limitConcurrency(os.availableParallelism?.() || os.cpus().length || 5) 55 56 56 57 for (const filepath of fileProjects) { 57 58 // if file leads to the root config, then we can just reuse it because we already initialized it