From: Chris Duncan Date: Wed, 4 Dec 2024 07:09:53 +0000 (-0800) Subject: Be greedy with system resources. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=47d38dc3e39935e151eda66c51d587ffb53a2546;p=libnemo.git Be greedy with system resources. --- 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[] = []