X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fdynamic-node-worker-threads-pool.mjs;h=fcb1d84c29ee43bcb5c615418d98cfe3819b84ad;hb=3eed0bf4399eec1a2e41e601d78ee7d888e8f3f5;hp=743b01d64e2b6086af087311809825d56c533f6d;hpb=8fca928868a8f73a16d5d990dda9a4480ea28ab5;p=poolifier.git diff --git a/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs b/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs index 743b01d6..fcb1d84c 100644 --- a/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs +++ b/benchmarks/versus-external-pools/dynamic-node-worker-threads-pool.mjs @@ -2,7 +2,7 @@ import { DynamicPool } 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) @@ -15,12 +15,13 @@ const data = { const pool = new DynamicPool(size) async function run () { - const promises = [] + const promises = new Set() for (let i = 0; i < iterations; i++) { - promises.push( + promises.add( pool.exec({ task: functionToBench, - param: data + param: data, + timeout: 60000 // this is the same as poolifier default }) ) }