fix(benchmark): add missing export
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 30 Mar 2024 18:32:04 +0000 (19:32 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 30 Mar 2024 18:32:04 +0000 (19:32 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
benchmarks/benchmarks-utils.mjs
benchmarks/internal/bench.mjs

index 1878988f2ab5491c87ec7a73adcc287e590228b4..03596b276c3cae5abd1b9fc074e11f7442ddf6ca 100644 (file)
@@ -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 }
index 442326a76f908fd0f9c301a67c09d9c6d40ef861..aa98be858bb66f6f819f4c52c190cab45c48d6fc 100644 (file)
@@ -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',