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());