From: Jérôme Benoit Date: Sun, 17 Sep 2023 11:38:33 +0000 (+0200) Subject: perf: add more possible configurations to continuous benchmarking X-Git-Tag: v2.6.45~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=617848e3c52c702a4412b74d505ce6076e54a5bb;p=poolifier.git perf: add more possible configurations to continuous benchmarking Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 2d553580..1d5ad240 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -7,6 +7,7 @@ import { DynamicThreadPool, FixedClusterPool, FixedThreadPool, + Measurements, PoolTypes, WorkerChoiceStrategies, WorkerTypes @@ -93,24 +94,59 @@ export const runPoolifierPoolBenchmark = async ( WorkerChoiceStrategies )) { for (const enableTasksQueue of [false, true]) { - suite.add( - `${name}|${workerChoiceStrategy}|${ - enableTasksQueue ? 'with' : 'without' - } tasks queue`, - async () => { - pool.setWorkerChoiceStrategy(workerChoiceStrategy) - pool.enableTasksQueue(enableTasksQueue) - assert.strictEqual( - pool.opts.workerChoiceStrategy, - workerChoiceStrategy + if (workerChoiceStrategy === WorkerChoiceStrategies.FAIR_SHARE) { + for (const measurement of [ + Measurements.runTime, + Measurements.elu + ]) { + suite.add( + `${name}|${workerChoiceStrategy}|${measurement}|${ + enableTasksQueue ? 'with' : 'without' + } tasks queue`, + async () => { + pool.setWorkerChoiceStrategy(workerChoiceStrategy, { + measurement + }) + pool.enableTasksQueue(enableTasksQueue) + assert.strictEqual( + pool.opts.workerChoiceStrategy, + workerChoiceStrategy + ) + assert.strictEqual( + pool.opts.enableTasksQueue, + enableTasksQueue + ) + assert.strictEqual( + pool.opts.workerChoiceStrategyOptions.measurement, + measurement + ) + await runPoolifierPool(pool, { + taskExecutions, + workerData + }) + } ) - assert.strictEqual(pool.opts.enableTasksQueue, enableTasksQueue) - await runPoolifierPool(pool, { - taskExecutions, - workerData - }) } - ) + } else { + suite.add( + `${name}|${workerChoiceStrategy}|${ + enableTasksQueue ? 'with' : 'without' + } tasks queue`, + async () => { + pool.setWorkerChoiceStrategy(workerChoiceStrategy) + pool.enableTasksQueue(enableTasksQueue) + assert.strictEqual( + pool.opts.workerChoiceStrategy, + workerChoiceStrategy + ) + assert.strictEqual(pool.opts.enableTasksQueue, enableTasksQueue) + await runPoolifierPool(pool, { + taskExecutions, + workerData + }) + } + ) + } } } suite