X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fstatic-node-worker-threads-pool.mjs;h=3632216b5daeed0771077f873bbf9bca5e69f177;hb=7953afc3f403f62c77dd3a4b1d98858bc3510540;hp=b943be5d4a60e1531371ce5151af359cde815674;hpb=8fca928868a8f73a16d5d990dda9a4480ea28ab5;p=poolifier.git diff --git a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs index b943be5d..3632216b 100644 --- a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs +++ b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs @@ -2,7 +2,7 @@ import { StaticPool } from 'node-worker-threads-pool' // FINISH IMPORT LIBRARIES // IMPORT FUNCTION TO BENCH -import functionToBench from './functions/function-to-bench.mjs' +import functionToBench from './functions/function-to-bench.js' // FINISH IMPORT FUNCTION TO BENCH const size = parseInt(process.env.POOL_SIZE) const iterations = parseInt(process.env.NUM_ITERATIONS) @@ -18,9 +18,9 @@ const pool = new StaticPool({ }) async function run () { - const promises = [] + const promises = new Set() for (let i = 0; i < iterations; i++) { - promises.push(pool.exec(data)) + promises.add(pool.exec(data)) } await Promise.all(promises) // eslint-disable-next-line n/no-process-exit