X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fstatic-node-worker-threads-pool.mjs;h=db14b180e6633461542a96a1df9f6b270e32bf80;hb=be7ac77efaa4c12f91a711020c8555f702d428d6;hp=3275d6f26e3a9a75574c4e0b961375a953fcf1f4;hpb=479ba9f6225633cd90167c26aa0fe0e79401b989;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 3275d6f2..db14b180 100644 --- a/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs +++ b/benchmarks/versus-external-pools/static-node-worker-threads-pool.mjs @@ -1,5 +1,5 @@ import { StaticPool } from 'node-worker-threads-pool' -import { executeAsyncFn } from '../benchmarks-utils.mjs' +import { executeAsyncFn } from './utils.mjs' import functionToBench from './functions/function-to-bench.js' const size = parseInt(process.env.POOL_SIZE) @@ -10,7 +10,7 @@ const data = { taskSize: parseInt(process.env.TASK_SIZE) } -const pool = new StaticPool({ +const staticPool = new StaticPool({ size, task: functionToBench }) @@ -18,7 +18,7 @@ const pool = new StaticPool({ async function run () { const promises = new Set() for (let i = 0; i < iterations; i++) { - promises.add(pool.exec(data)) + promises.add(staticPool.exec(data)) } await Promise.all(promises) // eslint-disable-next-line n/no-process-exit