X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Ffixed-tinypool.mjs;h=07b3abe84a2cd258c26e2d4b3bc9f85bfd4f96ee;hb=7d27ec0dd77a2b67c9e7ab20831bc70a6051a853;hp=c6e7c04996964aaf1c6f51940c698a336aff2ed1;hpb=6bb19f6bf0e0d262e46fa60324990135404e6d0d;p=poolifier.git diff --git a/benchmarks/versus-external-pools/fixed-tinypool.mjs b/benchmarks/versus-external-pools/fixed-tinypool.mjs index c6e7c049..07b3abe8 100644 --- a/benchmarks/versus-external-pools/fixed-tinypool.mjs +++ b/benchmarks/versus-external-pools/fixed-tinypool.mjs @@ -10,23 +10,20 @@ const data = { } const tinypool = new Tinypool({ - filename: './workers/tinypool/function-to-bench-worker.js', + filename: './workers/tinypool/function-to-bench-worker.mjs', minThreads: size, maxThreads: size, idleTimeout: 60000 // this is the same as poolifier default }) -/** - * - */ async function run () { - const promises = [] + const promises = new Set() for (let i = 0; i < iterations; i++) { - promises.push(tinypool.run(data)) + promises.add(tinypool.run(data)) } await Promise.all(promises) // eslint-disable-next-line n/no-process-exit process.exit() } -run() +await run()