X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fthread%2Ffixed.js;h=c8be6feb17c3fe92a30602b58c3aaba8482f9bc3;hb=3528c992d348d18ae41e803ac202e1e15ec31589;hp=3f40f3fbcac920f9f4013bdb59d3c155fdb42b57;hpb=d1a9aa414b60e38c91f5623f3572dc46c50f5f14;p=poolifier.git diff --git a/benchmarks/internal/thread/fixed.js b/benchmarks/internal/thread/fixed.js index 3f40f3fb..c8be6feb 100644 --- a/benchmarks/internal/thread/fixed.js +++ b/benchmarks/internal/thread/fixed.js @@ -12,10 +12,22 @@ const fixedPool = new FixedThreadPool( './benchmarks/internal/thread/worker.js' ) -const fixedPoolLessRecentlyUsed = new FixedThreadPool( +const fixedPoolTasksQueue = new FixedThreadPool( size, './benchmarks/internal/thread/worker.js', - { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED } + { enableTasksQueue: true } +) + +const fixedPoolLessUsed = new FixedThreadPool( + size, + './benchmarks/internal/thread/worker.js', + { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED } +) + +const fixedPoolLessBusy = new FixedThreadPool( + size, + './benchmarks/internal/thread/worker.js', + { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY } ) const fixedPoolWeightedRoundRobin = new FixedThreadPool( @@ -36,10 +48,22 @@ async function fixedThreadTest ( return runPoolifierTest(fixedPool, { tasks, workerData }) } -async function fixedThreadTestLessRecentlyUsed ( +async function fixedThreadTasksQueueTest ( + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } +) { + return runPoolifierTest(fixedPoolTasksQueue, { tasks, workerData }) +} + +async function fixedThreadTestLessUsed ( + { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } +) { + return runPoolifierTest(fixedPoolLessUsed, { tasks, workerData }) +} + +async function fixedThreadTestLessBusy ( { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } } ) { - return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData }) + return runPoolifierTest(fixedPoolLessBusy, { tasks, workerData }) } async function fixedThreadTestWeightedRoundRobin ( @@ -56,7 +80,9 @@ async function fixedThreadTestFairShare ( module.exports = { fixedThreadTest, - fixedThreadTestLessRecentlyUsed, + fixedThreadTasksQueueTest, + fixedThreadTestLessUsed, + fixedThreadTestLessBusy, fixedThreadTestWeightedRoundRobin, fixedThreadTestFairShare }