X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.mjs;h=891ff9eca7118d5bb530e43d23315dcbdfa7c59f;hb=4e1212db1d198963828820471bde6902277d0388;hp=c20b011f22afe762c36cde0ad6e7a1340586b170;hpb=e8114b2331ef47224aae1221693d8c9011ef7926;p=poolifier.git diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index c20b011f..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' @@ -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 })