repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chore: v2.4.8
[poolifier.git]
/
benchmarks
/
internal
/
cluster
/
dynamic.js
diff --git
a/benchmarks/internal/cluster/dynamic.js
b/benchmarks/internal/cluster/dynamic.js
index 60ee14f6942efdf32c5d7bb8aa52e3f2250f5990..475ba9d79b953fdfabf075010d94ddb979fe93eb 100644
(file)
--- a/
benchmarks/internal/cluster/dynamic.js
+++ b/
benchmarks/internal/cluster/dynamic.js
@@
-20,6
+20,13
@@
const dynamicPoolLessUsed = new DynamicClusterPool(
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
)
+const dynamicPoolLessBusy = new DynamicClusterPool(
+ size / 2,
+ size * 3,
+ './benchmarks/internal/cluster/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+)
+
const dynamicPoolWeightedRoundRobin = new DynamicClusterPool(
size / 2,
size * 3,
const dynamicPoolWeightedRoundRobin = new DynamicClusterPool(
size / 2,
size * 3,
@@
-46,6
+53,12
@@
async function dynamicClusterTestLessUsed (
return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
}
return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
}
+async function dynamicClusterTestLessBusy (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(dynamicPoolLessBusy, { tasks, workerData })
+}
+
async function dynamicClusterTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
async function dynamicClusterTestWeightedRoundRobin (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
@@
-61,6
+74,7
@@
async function dynamicClusterTestFairShare (
module.exports = {
dynamicClusterTest,
dynamicClusterTestLessUsed,
module.exports = {
dynamicClusterTest,
dynamicClusterTestLessUsed,
+ dynamicClusterTestLessBusy,
dynamicClusterTestWeightedRoundRobin,
dynamicClusterTestFairShare
}
dynamicClusterTestWeightedRoundRobin,
dynamicClusterTestFairShare
}