From 88dcefadc13b89cc4693cfb02f188b5aadd64821 Mon Sep 17 00:00:00 2001 From: patak Date: Wed, 16 Feb 2022 06:45:51 +0100 Subject: [PATCH] perf: enable tinypool useAtomics in node env (#763) --- packages/vitest/src/node/pool.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vitest/src/node/pool.ts b/packages/vitest/src/node/pool.ts index 2873c5ed82f2..7dcfd421137a 100644 --- a/packages/vitest/src/node/pool.ts +++ b/packages/vitest/src/node/pool.ts @@ -62,10 +62,9 @@ export function createWorkerPool(ctx: Vitest): WorkerPool { const options: TinypoolOptions = { filename: workerPath, - // Disable this for now, for WebContainer capability + // Disable this for now for WebContainers // https://github.com/vitest-dev/vitest/issues/93 - // In future we could conditionally enable it based on the env - useAtomics: false, + useAtomics: typeof process.versions.webcontainer !== 'string', maxThreads: ctx.config.maxThreads ?? threadsCount, minThreads: ctx.config.minThreads ?? threadsCount,