X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fstatic-suchmokuo-node-worker-threads-pool.js;h=75f3d2a438fd3cc1b1a963e626f6b2cccecff69d;hb=74f29142ea20199700ef7021402616ea9de714a8;hp=df7edd81519e0500305b0de60885ab43bc13dd8d;hpb=be0676b3936d75f22ce55b0f71a1fb03d008a01c;p=poolifier.git diff --git a/benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js b/benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js index df7edd81..75f3d2a4 100644 --- a/benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js +++ b/benchmarks/versus-external-pools/static-suchmokuo-node-worker-threads-pool.js @@ -1,17 +1,19 @@ // IMPORT LIBRARIES -const { DynamicPool, StaticPool } = require('node-worker-threads-pool') +const { StaticPool } = require('node-worker-threads-pool') // FINISH IMPORT LIBRARIES // IMPORT FUNCTION TO BENCH -const functionToBench = require('./functions/json-stringify') +const functionToBench = require('./functions/function-to-bench') // FINISH IMPORT FUNCTION TO BENCH -const size = process.env.POOL_SIZE -const iterations = process.env.NUM_ITERATIONS +const size = parseInt(process.env.POOL_SIZE) +const iterations = parseInt(process.env.NUM_ITERATIONS) const data = { - test: 'MYBENCH' + test: 'MYBENCH', + taskType: process.env.TASK_TYPE, + taskSize: parseInt(process.env.TASK_SIZE) } const pool = new StaticPool({ - size: Number(size), + size, task: functionToBench }) @@ -21,6 +23,7 @@ async function run () { promises.push(pool.exec(data)) } await Promise.all(promises) + // eslint-disable-next-line n/no-process-exit process.exit() }