From a6bef8d25e5de99cd86083a21b04030d335b9ee2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 30 Mar 2024 19:32:04 +0100 Subject: [PATCH] fix(benchmark): add missing export MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- benchmarks/benchmarks-utils.mjs | 3 +++ benchmarks/internal/bench.mjs | 27 +++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/benchmarks/benchmarks-utils.mjs b/benchmarks/benchmarks-utils.mjs index 1878988f..03596b27 100644 --- a/benchmarks/benchmarks-utils.mjs +++ b/benchmarks/benchmarks-utils.mjs @@ -13,6 +13,7 @@ import { WorkerChoiceStrategies, WorkerTypes } from '../lib/index.mjs' +import { executeTaskFunction } from './benchmarks-utils.cjs' const buildPoolifierPool = (workerType, poolType, poolSize, poolOptions) => { switch (poolType) { @@ -249,3 +250,5 @@ const LIST_FORMATTER = new Intl.ListFormat('en-US', { style: 'long', type: 'conjunction' }) + +export { executeTaskFunction } diff --git a/benchmarks/internal/bench.mjs b/benchmarks/internal/bench.mjs index 442326a7..aa98be85 100644 --- a/benchmarks/internal/bench.mjs +++ b/benchmarks/internal/bench.mjs @@ -21,24 +21,23 @@ const workerData = { taskSize: 50000 } -const options = { - type: { - type: 'string', - short: 't' - } -} -const { values } = parseArgs({ - args: process.argv, - options, - strict: true, - allowPositionals: true -}) - let fixedThreadPool let dynamicThreadPool let fixedClusterPool let dynamicClusterPool -switch (values.type) { +switch ( + parseArgs({ + args: process.argv, + options: { + type: { + type: 'string', + short: 't' + } + }, + strict: true, + allowPositionals: true + }).values.type +) { case 'mitata': fixedThreadPool = buildPoolifierBenchmarkMitata( 'FixedThreadPool', -- 2.34.1