X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fweighted-round-robin-worker-choice-strategy.ts;h=17ae66478606990c44244f44c46a9d8e5f8fb943;hb=0bbf65c3768b86f989056de36de0199d6e35562a;hp=df45feb3829a4972962d1f51aeeb1e7bcfbc1d7d;hpb=8c3ec188d4623aed43f2834325fb324d8fde1122;p=poolifier.git diff --git a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts index df45feb3..17ae6647 100644 --- a/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/weighted-round-robin-worker-choice-strategy.ts @@ -1,4 +1,3 @@ -import { cpus } from 'node:os' import type { IWorker } from '../worker' import type { IPool } from '../pool' import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils' @@ -101,15 +100,4 @@ export class WeightedRoundRobinWorkerChoiceStrategy< } return true } - - private computeDefaultWorkerWeight (): number { - let cpusCycleTimeWeight = 0 - for (const cpu of cpus()) { - // CPU estimated cycle time - const numberOfDigits = cpu.speed.toString().length - 1 - const cpuCycleTime = 1 / (cpu.speed / Math.pow(10, numberOfDigits)) - cpusCycleTimeWeight += cpuCycleTime * Math.pow(10, numberOfDigits) - } - return Math.round(cpusCycleTimeWeight / cpus().length) - } }