const runPoolifierPoolBenchmark = async (
name,
- pool,
+ workerType,
+ poolType,
+ poolSize,
{ taskExecutions, workerData }
) => {
+ const pool = buildPoolifierPool(workerType, poolType, poolSize)
+ const suite = new Benchmark.Suite(name)
return await new Promise((resolve, reject) => {
try {
- const suite = new Benchmark.Suite(name)
for (const workerChoiceStrategy of Object.values(
WorkerChoiceStrategies
)) {
LIST_FORMATTER.format(this.filter('fastest').map('name'))
)
await pool.destroy()
- pool = undefined
resolve()
})
.run({ async: true })
} catch (error) {
- reject(error)
+ pool
+ .destroy()
+ .then(() => {
+ return reject(error)
+ })
+ .catch(() => {})
}
})
}
module.exports = {
LIST_FORMATTER,
- buildPoolifierPool,
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark