perf(benchmark): port to homemade mitata fork
[poolifier.git] / benchmarks / benchmarks-utils.mjs
index 5db55b3b11c9b8c956e46397674e71a34471d241..48101fdaadc434073f81906a0ad0d7095e3f675a 100644 (file)
@@ -1,7 +1,7 @@
 import { strictEqual } from 'node:assert'
 
 import Benchmark from 'benchmark'
-import { bench, group } from 'mitata'
+import { bench, clear, group, run } from 'mitata'
 
 import {
   DynamicClusterPool,
@@ -249,7 +249,7 @@ export const runPoolifierBenchmarkBenchmarkJsSuite = async (
   })
 }
 
-export const buildPoolifierBenchmarkMitata = (
+export const runPoolifierBenchmarkMitata = async (
   name,
   workerType,
   poolType,
@@ -313,7 +313,9 @@ export const buildPoolifierBenchmarkMitata = (
         }
       }
     }
-    return pool
+    await run()
+    await pool.destroy()
+    clear()
   } catch (error) {
     console.error(error)
   }