Skip to content

Commit

Permalink
Limit the number of workers that can be spawned (#7430)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhamley authored Oct 18, 2018
1 parent 71ed65a commit 58a61d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/worker_pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ export default class WorkerPool {
}
}

WorkerPool.workerCount = Math.max(Math.floor(browser.hardwareConcurrency / 2), 1);
const availableLogicalProcessors = Math.floor(browser.hardwareConcurrency / 2);
WorkerPool.workerCount = Math.max(Math.min(availableLogicalProcessors, 6), 1);

0 comments on commit 58a61d6

Please sign in to comment.