X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=a14ecd5f12086acf98e64cc2c877c68b0bbbf91f;hb=4a038312beabc5b06fd14c99a41670b8d8b18251;hp=193827f3a24da416f58e079dd8cd546c8b50d8cd;hpb=de2e7182cca6b34b000a09bf6d0ddcff4757db3a;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 193827f3..a14ecd5f 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -7,7 +7,7 @@ import { availableParallelism } from '../../lib/index.mjs' import { TaskFunctions } from '../benchmarks-types.mjs' -import { buildPool, runTest } from '../benchmarks-utils.mjs' +import { buildPoolifierPool, runPoolifierTest } from '../benchmarks-utils.mjs' const poolSize = availableParallelism() const pools = [] @@ -22,7 +22,7 @@ for (const poolType of Object.values(PoolTypes)) { for (const measurement of [Measurements.runTime, Measurements.elu]) { pools.push([ `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}|measurement:${measurement}`, - buildPool(workerType, poolType, poolSize, { + buildPoolifierPool(workerType, poolType, poolSize, { workerChoiceStrategy, workerChoiceStrategyOptions: { measurement @@ -34,7 +34,7 @@ for (const poolType of Object.values(PoolTypes)) { } else { pools.push([ `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}`, - buildPool(workerType, poolType, poolSize, { + buildPoolifierPool(workerType, poolType, poolSize, { workerChoiceStrategy, enableTasksQueue }) @@ -50,10 +50,10 @@ const workerData = { function: TaskFunctions.jsonIntegerSerialization, taskSize: 1000 } -const addPools = (pools) => +const addPools = pools => pools.map(([name, pool]) => { return add(name, async () => { - await runTest(pool, { + await runPoolifierTest(pool, { taskExecutions, workerData }) @@ -90,4 +90,4 @@ suite( // eslint-disable-next-line n/no-process-exit return process.exit() }) - .catch((err) => console.error(err)) + .catch(err => console.error(err))