]> zoso.dev Git - libnemo.git/commitdiff
Be greedy with system resources.
authorChris Duncan <chris@zoso.dev>
Wed, 4 Dec 2024 07:09:53 +0000 (23:09 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 4 Dec 2024 07:09:53 +0000 (23:09 -0800)
src/lib/pool.ts

index 336c5c1e4cbf6a9f39dbb2c1e6483162e656af0e..245b6ee805fe8f6c02a0dc28b635171041882bfe 100644 (file)
@@ -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[] = []