From: Jérôme Benoit Date: Wed, 19 Apr 2023 18:09:31 +0000 (+0200) Subject: perf: add tasks queue to more benchmark X-Git-Tag: v2.4.11~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d9f14be6275993cf4485db8a40a20730b1571a59;p=poolifier.git perf: add tasks queue to more benchmark Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/internal/bench.js b/benchmarks/internal/bench.js index d615f66e..4663d9c4 100644 --- a/benchmarks/internal/bench.js +++ b/benchmarks/internal/bench.js @@ -72,6 +72,13 @@ const fixedThreadPoolFairShare = buildPool( workerChoiceStrategyFairSharePoolOption ) +const fixedThreadPoolFairShareTasksQueue = buildPool( + WorkerTypes.THREAD, + PoolTypes.FIXED, + poolSize, + { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption } +) + const dynamicThreadPoolRoundRobin = buildPool( WorkerTypes.THREAD, PoolTypes.DYNAMIC, @@ -149,6 +156,13 @@ const fixedClusterPoolFairShare = buildPool( workerChoiceStrategyFairSharePoolOption ) +const fixedClusterPoolFairShareTaskQueue = buildPool( + WorkerTypes.CLUSTER, + PoolTypes.FIXED, + poolSize, + { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption } +) + const dynamicClusterPoolRoundRobin = buildPool( WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, @@ -228,6 +242,15 @@ Benchmark.suite( workerData }) }), + Benchmark.add( + 'Fixed:ThreadPool:FairShare:{ enableTasksQueue: true }', + async () => { + await runTest(fixedThreadPoolFairShareTasksQueue, { + taskExecutions, + workerData + }) + } + ), Benchmark.add('Dynamic:ThreadPool:RoundRobin', async () => { await runTest(dynamicThreadPoolRoundRobin, { taskExecutions, @@ -297,6 +320,15 @@ Benchmark.suite( workerData }) }), + Benchmark.add( + 'Fixed:ClusterPool:FairShare:{ enableTasksQueue: true }', + async () => { + await runTest(fixedClusterPoolFairShareTaskQueue, { + taskExecutions, + workerData + }) + } + ), Benchmark.add('Dynamic:ClusterPool:RoundRobin', async () => { await runTest(dynamicClusterPoolRoundRobin, { taskExecutions,