repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v3.0.5
[poolifier.git]
/
benchmarks
/
benchmarks-utils.js
diff --git
a/benchmarks/benchmarks-utils.js
b/benchmarks/benchmarks-utils.js
index aaf7521ff3044807e02078c2cde0f45c584586b1..678b41d7634e56254c3cfb660738aea2cf8ee20d 100644
(file)
--- a/
benchmarks/benchmarks-utils.js
+++ b/
benchmarks/benchmarks-utils.js
@@
-64,7
+64,7
@@
const runPoolifierPool = async (pool, { taskExecutions, workerData }) => {
if (executions === taskExecutions) {
resolve({ ok: 1 })
}
if (executions === taskExecutions) {
resolve({ ok: 1 })
}
- return
null
+ return
undefined
})
.catch(err => {
console.error(err)
})
.catch(err => {
console.error(err)
@@
-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
)) {
@@
-155,7
+158,12
@@
const runPoolifierPoolBenchmark = async (
})
.run({ async: true })
} catch (error) {
})
.run({ async: true })
} catch (error) {
- reject(error)
+ pool
+ .destroy()
+ .then(() => {
+ return reject(error)
+ })
+ .catch(() => {})
}
})
}
}
})
}
@@
-248,7
+256,6
@@
const executeTaskFunction = data => {
module.exports = {
LIST_FORMATTER,
module.exports = {
LIST_FORMATTER,
- buildPoolifierPool,
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark
executeTaskFunction,
generateRandomInteger,
runPoolifierPoolBenchmark