X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fcluster%2Ffixed.js;h=7e31a838eceaaa271abcc7cf9a277a70eb6bbc75;hb=6c9d7004857091d1d46e65cb7a9871bb271a2516;hp=388689a3be7e5bc8ba37e38e7b53cd1b902f0d22;hpb=2d401b2d21b1d9225c9168f85e32234353feb0c3;p=poolifier.git diff --git a/benchmarks/internal/cluster/fixed.js b/benchmarks/internal/cluster/fixed.js index 388689a3..7e31a838 100644 --- a/benchmarks/internal/cluster/fixed.js +++ b/benchmarks/internal/cluster/fixed.js @@ -2,7 +2,7 @@ const { FixedClusterPool, WorkerChoiceStrategies } = require('../../../lib/index') -const { runPoolifierTest } = require('../benchmark-utils') +const { runPoolifierTest } = require('../../benchmarks-utils') const size = 30 const numberOfTasks = 1 @@ -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 }