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): bump typescript
[poolifier.git]
/
benchmarks
/
versus-external-pools
/
dynamic-tinypool.mjs
diff --git
a/benchmarks/versus-external-pools/dynamic-tinypool.mjs
b/benchmarks/versus-external-pools/dynamic-tinypool.mjs
index 68d73b67381f4c5a987221693a98fd84a5a1a28b..c1de377230add86db85da551bfb98d2558957bcd 100644
(file)
--- a/
benchmarks/versus-external-pools/dynamic-tinypool.mjs
+++ b/
benchmarks/versus-external-pools/dynamic-tinypool.mjs
@@
-10,20
+10,20
@@
const data = {
}
const tinypool = new Tinypool({
}
const tinypool = new Tinypool({
- filename: './workers/tinypool/function-to-bench-worker.js',
- minThreads:
size
,
- maxThreads: size
* 3
,
+ filename: './workers/tinypool/function-to-bench-worker.
m
js',
+ minThreads:
Math.floor(size / 2)
,
+ maxThreads: size,
idleTimeout: 60000 // this is the same as poolifier default
})
async function run () {
idleTimeout: 60000 // this is the same as poolifier default
})
async function run () {
- const promises =
[]
+ const promises =
new Set()
for (let i = 0; i < iterations; i++) {
for (let i = 0; i < iterations; i++) {
- promises.
push
(tinypool.run(data))
+ promises.
add
(tinypool.run(data))
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit
process.exit()
}
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit
process.exit()
}
-run()
+
await
run()