Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-worker_thr...
[poolifier.git] / benchmarks / versus-external-pools / static-node-worker-threads-pool.mjs
index 3275d6f26e3a9a75574c4e0b961375a953fcf1f4..db14b180e6633461542a96a1df9f6b270e32bf80 100644 (file)
@@ -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