X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Fversus-external-pools%2Fdynamic-suchmokuo-node-worker-threads-pool.js;h=0a56d1fd2326555ca7804d4850efb87670a517f2;hb=765457872257684691f93befb94175a2aaa83502;hp=8bf964d24119aa5cbaf746378859a2c8065add74;hpb=be0676b3936d75f22ce55b0f71a1fb03d008a01c;p=poolifier.git diff --git a/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js b/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js index 8bf964d2..0a56d1fd 100644 --- a/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js +++ b/benchmarks/versus-external-pools/dynamic-suchmokuo-node-worker-threads-pool.js @@ -1,16 +1,18 @@ // IMPORT LIBRARIES -const { DynamicPool, StaticPool } = require('node-worker-threads-pool') +const { DynamicPool } = 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 DynamicPool(Number(size)) +const pool = new DynamicPool(size) async function run () { const promises = [] @@ -23,6 +25,7 @@ async function run () { ) } await Promise.all(promises) + // eslint-disable-next-line n/no-process-exit process.exit() }