repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: use UUIDv4 for message id to avoid integer overflow
[poolifier.git]
/
benchmarks
/
internal
/
cluster
/
fixed.js
diff --git
a/benchmarks/internal/cluster/fixed.js
b/benchmarks/internal/cluster/fixed.js
index 548ed9f9eb1518a697069ee8d5cd68a6a2f61830..da691aa9237a387d1b6d2cfe4ffe01d64cf506f9 100644
(file)
--- a/
benchmarks/internal/cluster/fixed.js
+++ b/
benchmarks/internal/cluster/fixed.js
@@
-2,7
+2,7
@@
const {
FixedClusterPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
FixedClusterPool,
WorkerChoiceStrategies
} = require('../../../lib/index')
-const { runPoolifierTest } = require('../
benchmark
-utils')
+const { runPoolifierTest } = require('../
../benchmarks
-utils')
const size = 30
const numberOfTasks = 1
const size = 30
const numberOfTasks = 1
@@
-18,6
+18,12
@@
const fixedPoolLessRecentlyUsed = new FixedClusterPool(
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
)
{ workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
)
+const fixedPoolWeightedRoundRobin = new FixedClusterPool(
+ size,
+ './benchmarks/internal/cluster/worker.js',
+ { workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN }
+)
+
const fixedPoolFairShare = new FixedClusterPool(
size,
'./benchmarks/internal/cluster/worker.js',
const fixedPoolFairShare = new FixedClusterPool(
size,
'./benchmarks/internal/cluster/worker.js',
@@
-36,6
+42,12
@@
async function fixedClusterTestLessRecentlyUsed (
return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData })
}
return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData })
}
+async function fixedClusterTestWeightedRoundRobin (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(fixedPoolWeightedRoundRobin, { tasks, workerData })
+}
+
async function fixedClusterTestFairShare (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
async function fixedClusterTestFairShare (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
@@
-44,6
+56,7
@@
async function fixedClusterTestFairShare (
module.exports = {
fixedClusterTest,
module.exports = {
fixedClusterTest,
- fixedClusterTestFairShare,
- fixedClusterTestLessRecentlyUsed
+ fixedClusterTestLessRecentlyUsed,
+ fixedClusterTestWeightedRoundRobin,
+ fixedClusterTestFairShare
}
}