X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=a14ecd5f12086acf98e64cc2c877c68b0bbbf91f;hb=a3b14eea63d3a2e1e473099cc502296b36cfa0c0;hp=8235d5727b9e0043c0948fd4dfbbb8249a57e05c;hpb=6bec21ed1a00f7a62c5ccc12d4bdf8f8998be978;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 8235d572..a14ecd5f 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -6,8 +6,8 @@ import { WorkerTypes, availableParallelism } from '../../lib/index.mjs' -import { WorkerFunctions } from '../benchmarks-types.mjs' -import { buildPool, runTest } from '../benchmarks-utils.mjs' +import { TaskFunctions } from '../benchmarks-types.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 }) @@ -47,13 +47,13 @@ for (const poolType of Object.values(PoolTypes)) { const taskExecutions = 1 const workerData = { - function: WorkerFunctions.jsonIntegerSerialization, + function: TaskFunctions.jsonIntegerSerialization, taskSize: 1000 } const addPools = pools => pools.map(([name, pool]) => { return add(name, async () => { - await runTest(pool, { + await runPoolifierTest(pool, { taskExecutions, workerData })