repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps-dev): apply updates
[poolifier.git]
/
benchmarks
/
benchmarks-utils.js
diff --git
a/benchmarks/benchmarks-utils.js
b/benchmarks/benchmarks-utils.js
index 48311a3f04b773c0d6f540eaf659b2b00f3e08d7..678b41d7634e56254c3cfb660738aea2cf8ee20d 100644
(file)
--- a/
benchmarks/benchmarks-utils.js
+++ b/
benchmarks/benchmarks-utils.js
@@
-76,12
+76,15
@@
const runPoolifierPool = async (pool, { taskExecutions, workerData }) => {
const runPoolifierPoolBenchmark = async (
name,
const runPoolifierPoolBenchmark = async (
name,
- pool,
+ workerType,
+ poolType,
+ poolSize,
{ taskExecutions, workerData }
) => {
{ taskExecutions, workerData }
) => {
+ const pool = buildPoolifierPool(workerType, poolType, poolSize)
+ const suite = new Benchmark.Suite(name)
return await new Promise((resolve, reject) => {
try {
return await new Promise((resolve, reject) => {
try {
- const suite = new Benchmark.Suite(name)
for (const workerChoiceStrategy of Object.values(
WorkerChoiceStrategies
)) {
for (const workerChoiceStrategy of Object.values(
WorkerChoiceStrategies
)) {
@@
-151,12
+154,16
@@
const runPoolifierPoolBenchmark = async (
LIST_FORMATTER.format(this.filter('fastest').map('name'))
)
await pool.destroy()
LIST_FORMATTER.format(this.filter('fastest').map('name'))
)
await pool.destroy()
- pool = undefined
resolve()
})
.run({ async: true })
} catch (error) {
resolve()
})
.run({ async: true })
} catch (error) {
- reject(error)
+ pool
+ .destroy()
+ .then(() => {
+ return reject(error)
+ })
+ .catch(() => {})
}
})
}
}
})
}
@@
-249,7
+256,6
@@
const executeTaskFunction = data => {
module.exports = {
LIST_FORMATTER,
module.exports = {
LIST_FORMATTER,
- buildPoolifierPool,
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark