fix: fix worker node event emitter memory leak
[poolifier.git] / benchmarks / benchmarks-utils.js
index 678b41d7634e56254c3cfb660738aea2cf8ee20d..b7826a0c27ae06a75921df2df531128685c57afb 100644 (file)
@@ -81,9 +81,9 @@ const runPoolifierPoolBenchmark = async (
   poolSize,
   { taskExecutions, workerData }
 ) => {
-  const pool = buildPoolifierPool(workerType, poolType, poolSize)
-  const suite = new Benchmark.Suite(name)
   return await new Promise((resolve, reject) => {
+    const pool = buildPoolifierPool(workerType, poolType, poolSize)
+    const suite = new Benchmark.Suite(name)
     try {
       for (const workerChoiceStrategy of Object.values(
         WorkerChoiceStrategies