2 const { FixedThreadPool
, DynamicThreadPool
} = require('poolifier')
3 // FINISH IMPORT LIBRARIES
4 const size
= process
.env
.POOL_SIZE
5 const iterations
= process
.env
.NUM_ITERATIONS
8 taskType
: process
.env
['TASK_TYPE']
11 const fixedPool
= new FixedThreadPool(
13 './workers/poolifier/function-to-bench-worker.js',
19 async
function run () {
21 for (let i
= 0; i
< iterations
; i
++) {
22 promises
.push(fixedPool
.execute(data
))
24 await Promise
.all(promises
)