X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=2749da428bfcda15d881b0f934d35b54f8a603f2;hb=aa7cbd39f3a378eea41b23c1f5bd1d17093b8f59;hp=48f30f66d0f47a14b1296b1279ebbee679309eb7;hpb=d9d8c14e8c3bf643e42c84b4cc5144da899dc744;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 48f30f66..2749da42 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -6,7 +6,7 @@ import { WorkerTypes, availableParallelism } from '../../lib/index.mjs' -import { WorkerFunctions } from '../benchmarks-types.mjs' +import { TaskFunctions } from '../benchmarks-types.mjs' import { buildPool, runTest } from '../benchmarks-utils.mjs' const poolSize = availableParallelism() @@ -20,26 +20,24 @@ for (const poolType of Object.values(PoolTypes)) { for (const enableTasksQueue of [false, true]) { if (workerChoiceStrategy === WorkerChoiceStrategies.FAIR_SHARE) { for (const measurement of [Measurements.runTime, Measurements.elu]) { - const pool = buildPool(workerType, poolType, poolSize, { - workerChoiceStrategy, - workerChoiceStrategyOptions: { - measurement - }, - enableTasksQueue - }) pools.push([ `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}|measurement:${measurement}`, - pool + buildPool(workerType, poolType, poolSize, { + workerChoiceStrategy, + workerChoiceStrategyOptions: { + measurement + }, + enableTasksQueue + }) ]) } } else { - const pool = buildPool(workerType, poolType, poolSize, { - workerChoiceStrategy, - enableTasksQueue - }) pools.push([ `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}`, - pool + buildPool(workerType, poolType, poolSize, { + workerChoiceStrategy, + enableTasksQueue + }) ]) } } @@ -49,7 +47,7 @@ for (const poolType of Object.values(PoolTypes)) { const taskExecutions = 1 const workerData = { - function: WorkerFunctions.jsonIntegerSerialization, + function: TaskFunctions.jsonIntegerSerialization, taskSize: 1000 } const addPools = pools =>