From 1b48c34974e0089a98c25dac361adc42d407ee64 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 4 Mar 2022 23:56:36 -0500 Subject: [PATCH] Better default worker count value --- lib/WorkerPool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WorkerPool.ts b/lib/WorkerPool.ts index 859bace..c30b17d 100644 --- a/lib/WorkerPool.ts +++ b/lib/WorkerPool.ts @@ -24,7 +24,7 @@ export class WorkerPool { this.availableWorkers = []; } - public async init(count: number = 8): Promise { + public async init(count: number = window.navigator.hardwareConcurrency ?? 8): Promise { this.availableWorkers = []; for (let i = 0; i < count; i++) { this.availableWorkers.push(await this.createWorker());