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)
taskSize: parseInt(process.env.TASK_SIZE)
}
-const pool = new StaticPool({
+const staticPool = new StaticPool({
size,
task: functionToBench
})
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