X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=benchmarks%2Finternal%2Fbench.mjs;h=891ff9eca7118d5bb530e43d23315dcbdfa7c59f;hb=4e1212db1d198963828820471bde6902277d0388;hp=7d3e90f288c478c84dd3cedabba6cb8a371a227a;hpb=1676d5b1693706c55cf9b098d999ef062b21e374;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 7d3e90f2..891ff9ec 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -10,6 +10,7 @@ import { TaskFunctions } from '../benchmarks-types.mjs' import { LIST_FORMATTER, buildPoolifierPool, + getPoolImplementationName, runPoolifierTest } from '../benchmarks-utils.mjs' @@ -23,7 +24,7 @@ const fixedThreadPool = buildPoolifierPool( const taskExecutions = 1 const workerData = { function: TaskFunctions.jsonIntegerSerialization, - taskSize: 100 + taskSize: 1000 } const poolifierSuite = new Benchmark.Suite('Poolifier') @@ -32,7 +33,7 @@ for (const pool of [fixedThreadPool]) { for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) { for (const enableTasksQueue of [false, true]) { poolifierSuite.add( - `${pool.constructor.name}|${workerChoiceStrategy}|${ + `${getPoolImplementationName(pool)}|${workerChoiceStrategy}|${ enableTasksQueue ? 'with' : 'without' } tasks queue`, async () => { @@ -57,10 +58,10 @@ poolifierSuite .on('cycle', event => { console.info(event.target.toString()) }) - .on('complete', function () { + .on('complete', async function () { console.info( 'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name')) ) - fixedThreadPool.destroy() + await fixedThreadPool.destroy() }) .run({ async: true })