refactor: cleanup benchmarking code
[poolifier.git] / benchmarks / internal / bench.mjs
index 7ef61bc6cba31225a4d8732b721422494deeb4d3..368cf29c949f487b3223b5dd90c74beedcd359d1 100644 (file)
@@ -4,10 +4,7 @@ import {
   availableParallelism
 } from '../../lib/index.mjs'
 import { TaskFunctions } from '../benchmarks-types.js'
-import {
-  buildPoolifierPool,
-  runPoolifierPoolBenchmark
-} from '../benchmarks-utils.js'
+import { runPoolifierPoolBenchmark } from '../benchmarks-utils.js'
 
 const poolSize = availableParallelism()
 const taskExecutions = 1
@@ -19,7 +16,9 @@ const workerData = {
 // FixedThreadPool
 await runPoolifierPoolBenchmark(
   'Poolifier FixedThreadPool',
-  buildPoolifierPool(WorkerTypes.thread, PoolTypes.fixed, poolSize),
+  WorkerTypes.thread,
+  PoolTypes.fixed,
+  poolSize,
   {
     taskExecutions,
     workerData
@@ -29,7 +28,9 @@ await runPoolifierPoolBenchmark(
 // DynamicThreadPool
 await runPoolifierPoolBenchmark(
   'Poolifier DynamicThreadPool',
-  buildPoolifierPool(WorkerTypes.thread, PoolTypes.dynamic, poolSize),
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
+  poolSize,
   {
     taskExecutions,
     workerData
@@ -39,7 +40,9 @@ await runPoolifierPoolBenchmark(
 // FixedClusterPool
 await runPoolifierPoolBenchmark(
   'Poolifier FixedClusterPool',
-  buildPoolifierPool(WorkerTypes.cluster, PoolTypes.fixed, poolSize),
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
+  poolSize,
   {
     taskExecutions,
     workerData
@@ -49,7 +52,9 @@ await runPoolifierPoolBenchmark(
 // DynamicClusterPool
 await runPoolifierPoolBenchmark(
   'Poolifier DynamicClusterPool',
-  buildPoolifierPool(WorkerTypes.cluster, PoolTypes.dynamic, poolSize),
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
+  poolSize,
   {
     taskExecutions,
     workerData