From 47d38dc3e39935e151eda66c51d587ffb53a2546 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 23:09:53 -0800 Subject: [PATCH] Be greedy with system resources. --- src/lib/pool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/pool.ts b/src/lib/pool.ts index 336c5c1..245b6ee 100644 --- a/src/lib/pool.ts +++ b/src/lib/pool.ts @@ -19,7 +19,7 @@ type Thread = { */ export class Pool { #approach: 'converge' | 'divide' = 'divide' - #cores: number = Math.max(1, Math.floor(navigator.hardwareConcurrency * 0.8)) + #cores: number = Math.max(1, navigator.hardwareConcurrency - 1) #queue: object[] = [] #resolve: Function = (value: unknown): void => { } #results: object[] = [] -- 2.34.1