From: Jérôme Benoit Date: Sat, 30 Mar 2024 18:32:04 +0000 (+0100) Subject: fix(benchmark): add missing export X-Git-Tag: v3.1.28~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a6bef8d25e5de99cd86083a21b04030d335b9ee2;p=poolifier.git fix(benchmark): add missing export Signed-off-by: Jérôme Benoit --- 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',