X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Ffixed-worker-threads-pool.js;fp=benchmarks%2Fversus-external-pools%2Ffixed-worker-threads-pool.js;h=0000000000000000000000000000000000000000;hb=73cda44834b69b6120f256d40351a504fb86c1ae;hp=b4d9ecedfad682d0e9a12e1615369327d6b70568;hpb=89e3192b83322814b62e5f5e575d3b8300fcadaa;p=poolifier.git diff --git a/benchmarks/versus-external-pools/fixed-worker-threads-pool.js b/benchmarks/versus-external-pools/fixed-worker-threads-pool.js deleted file mode 100644 index b4d9eced..00000000 --- a/benchmarks/versus-external-pools/fixed-worker-threads-pool.js +++ /dev/null @@ -1,37 +0,0 @@ -// IMPORT LIBRARIES -const Pool = require('worker-threads-pool') -// FINISH IMPORT LIBRARIES -const size = Number(process.env.POOL_SIZE) -const iterations = Number(process.env.NUM_ITERATIONS) -const data = { - test: 'MYBENCH', - taskType: process.env['TASK_TYPE'] -} - -const pool = new Pool({ max: size }) - -async function poolAcquireAsync () { - return new Promise((resolve, reject) => { - pool.acquire( - './workers/worker-threads-pool/function-to-bench-worker.js', - { - workerData: data - }, - err => { - if (err) reject(err) - resolve() - } - ) - }) -} - -async function run () { - const promises = [] - for (let i = 0; i < iterations; i++) { - promises.push(poolAcquireAsync()) - } - await Promise.all(promises) - process.exit() -} - -run()