perf: workaround ESM issue with cluster
[poolifier.git] / benchmarks / internal / bench.mjs
index 3484951cfb187a42bf1af5f325cd1c436adb6baf..7ef61bc6cba31225a4d8732b721422494deeb4d3 100644 (file)
@@ -3,11 +3,11 @@ import {
   WorkerTypes,
   availableParallelism
 } from '../../lib/index.mjs'
-import { TaskFunctions } from '../benchmarks-types.mjs'
+import { TaskFunctions } from '../benchmarks-types.js'
 import {
   buildPoolifierPool,
   runPoolifierPoolBenchmark
-} from '../benchmarks-utils.mjs'
+} from '../benchmarks-utils.js'
 
 const poolSize = availableParallelism()
 const taskExecutions = 1
@@ -35,3 +35,23 @@ await runPoolifierPoolBenchmark(
     workerData
   }
 )
+
+// FixedClusterPool
+await runPoolifierPoolBenchmark(
+  'Poolifier FixedClusterPool',
+  buildPoolifierPool(WorkerTypes.cluster, PoolTypes.fixed, poolSize),
+  {
+    taskExecutions,
+    workerData
+  }
+)
+
+// DynamicClusterPool
+await runPoolifierPoolBenchmark(
+  'Poolifier DynamicClusterPool',
+  buildPoolifierPool(WorkerTypes.cluster, PoolTypes.dynamic, poolSize),
+  {
+    taskExecutions,
+    workerData
+  }
+)