'./benchmarks/internal/cluster/worker.js'
)
-const dynamicPoolLessRecentlyUsed = new DynamicClusterPool(
+const dynamicPoolLessUsed = new DynamicClusterPool(
size / 2,
size * 3,
'./benchmarks/internal/cluster/worker.js',
- { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_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(
return runPoolifierTest(dynamicPool, { tasks, workerData })
}
-async function dynamicClusterTestLessRecentlyUsed (
+async function dynamicClusterTestLessUsed (
+ { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+ return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
+}
+
+async function dynamicClusterTestLessBusy (
{ tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
) {
- return runPoolifierTest(dynamicPoolLessRecentlyUsed, { tasks, workerData })
+ return runPoolifierTest(dynamicPoolLessBusy, { tasks, workerData })
}
async function dynamicClusterTestWeightedRoundRobin (
module.exports = {
dynamicClusterTest,
- dynamicClusterTestLessRecentlyUsed,
+ dynamicClusterTestLessUsed,
+ dynamicClusterTestLessBusy,
dynamicClusterTestWeightedRoundRobin,
dynamicClusterTestFairShare
}