X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster%2Ffixed.js;h=7e31a838eceaaa271abcc7cf9a277a70eb6bbc75;hb=ffe8ca52bf1a05f68a0c939d16f15b6b54028be9;hp=da691aa9237a387d1b6d2cfe4ffe01d64cf506f9;hpb=d1a9aa414b60e38c91f5623f3572dc46c50f5f14;p=poolifier.git diff --git a/benchmarks/internal/cluster/fixed.js b/benchmarks/internal/cluster/fixed.js index da691aa9..7e31a838 100644 --- a/benchmarks/internal/cluster/fixed.js +++ b/benchmarks/internal/cluster/fixed.js @@ -12,10 +12,16 @@ const fixedPool = new FixedClusterPool( './benchmarks/internal/cluster/worker.js' ) -const fixedPoolLessRecentlyUsed = new FixedClusterPool( +const fixedPoolLessUsed = new FixedClusterPool( size, './benchmarks/internal/cluster/worker.js', - { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED } + { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED } +) + +const fixedPoolLessBusy = new FixedClusterPool( + size, + './benchmarks/internal/cluster/worker.js', + { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY } ) const fixedPoolWeightedRoundRobin = new FixedClusterPool( @@ -36,10 +42,16 @@ async function fixedClusterTest ( return runPoolifierTest(fixedPool, { tasks, workerData }) } -async function fixedClusterTestLessRecentlyUsed ( +async function fixedClusterTestLessUsed ( + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } +) { + return runPoolifierTest(fixedPoolLessUsed, { tasks, workerData }) +} + +async function fixedClusterTestLessBusy ( { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } ) { - return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData }) + return runPoolifierTest(fixedPoolLessBusy, { tasks, workerData }) } async function fixedClusterTestWeightedRoundRobin ( @@ -56,7 +68,8 @@ async function fixedClusterTestFairShare ( module.exports = { fixedClusterTest, - fixedClusterTestLessRecentlyUsed, + fixedClusterTestLessUsed, + fixedClusterTestLessBusy, fixedClusterTestWeightedRoundRobin, fixedClusterTestFairShare }