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-worker-nodes.js
diff --git
a/benchmarks/versus-external-pools/dynamic-worker-nodes.js
b/benchmarks/versus-external-pools/dynamic-worker-nodes.js
index fffa55948228696811dd1961f306df2241c44ae2..7a77d88278877f1acdcc037b8cd55717c76759ee 100644
(file)
--- a/
benchmarks/versus-external-pools/dynamic-worker-nodes.js
+++ b/
benchmarks/versus-external-pools/dynamic-worker-nodes.js
@@
-1,3
+1,4
@@
+'use strict'
// IMPORT LIBRARIES
const WorkerNodes = require('worker-nodes')
// FINISH IMPORT LIBRARIES
// IMPORT LIBRARIES
const WorkerNodes = require('worker-nodes')
// FINISH IMPORT LIBRARIES
@@
-12,16
+13,16
@@
const data = {
const workerNodes = new WorkerNodes(
require.resolve('./workers/worker-nodes/function-to-bench-worker'),
{
const workerNodes = new WorkerNodes(
require.resolve('./workers/worker-nodes/function-to-bench-worker'),
{
- minWorkers:
size
,
- maxWorkers: size
* 3
,
+ minWorkers:
Math.floor(size / 2)
,
+ maxWorkers: size,
taskTimeout: 60000 // this is the same as poolifier default
}
)
async function run () {
taskTimeout: 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
(workerNodes.call.functionToBench(data))
+ promises.
add
(workerNodes.call.functionToBench(data))
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit
}
await Promise.all(promises)
// eslint-disable-next-line n/no-process-exit