X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=benchmarks%2Finternal%2Fbench.js;h=4663d9c42bf2f27f38b78cb417acbe96bf6f2e86;hb=da3e130085b6eeafad308073b293eaba3f10baf7;hp=4c126a00fb9d531011b71cb52e459c2aa017b695;hpb=cdace0e5b9082804893de9501372490ee1064090;p=poolifier.git diff --git a/benchmarks/internal/bench.js b/benchmarks/internal/bench.js index 4c126a00..4663d9c4 100644 --- a/benchmarks/internal/bench.js +++ b/benchmarks/internal/bench.js @@ -31,156 +31,170 @@ const workerChoiceStrategyFairSharePoolOption = { } const fixedThreadPoolRoundRobin = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyRoundRobinPoolOption ) const fixedThreadPoolRoundRobinTasksQueue = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption } ) const fixedThreadPoolLessUsed = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyLessUsedPoolOption ) const fixedThreadPoolLessBusy = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyLessBusyPoolOption ) const fixedThreadPoolWeightedRoundRobin = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyWeightedRoundRobinPoolOption ) const fixedThreadPoolFairShare = buildPool( + WorkerTypes.THREAD, PoolTypes.FIXED, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyFairSharePoolOption ) +const fixedThreadPoolFairShareTasksQueue = buildPool( + WorkerTypes.THREAD, + PoolTypes.FIXED, + poolSize, + { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption } +) + const dynamicThreadPoolRoundRobin = buildPool( + WorkerTypes.THREAD, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyRoundRobinPoolOption ) const dynamicThreadPoolLessUsed = buildPool( + WorkerTypes.THREAD, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyLessUsedPoolOption ) const dynamicThreadPoolLessBusy = buildPool( + WorkerTypes.THREAD, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyLessBusyPoolOption ) const dynamicThreadPoolWeightedRoundRobin = buildPool( + WorkerTypes.THREAD, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyWeightedRoundRobinPoolOption ) const dynamicThreadPoolFairShare = buildPool( + WorkerTypes.THREAD, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.THREAD, workerChoiceStrategyFairSharePoolOption ) const fixedClusterPoolRoundRobin = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyRoundRobinPoolOption ) const fixedClusterPoolRoundRobinTasksQueue = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption } ) const fixedClusterPoolLessUsed = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyLessUsedPoolOption ) const fixedClusterPoolLessBusy = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyLessBusyPoolOption ) const fixedClusterPoolWeightedRoundRobin = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyWeightedRoundRobinPoolOption ) const fixedClusterPoolFairShare = buildPool( + WorkerTypes.CLUSTER, PoolTypes.FIXED, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyFairSharePoolOption ) +const fixedClusterPoolFairShareTaskQueue = buildPool( + WorkerTypes.CLUSTER, + PoolTypes.FIXED, + poolSize, + { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption } +) + const dynamicClusterPoolRoundRobin = buildPool( + WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyRoundRobinPoolOption ) const dynamicClusterPoolLessUsed = buildPool( + WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyLessUsedPoolOption ) const dynamicClusterPoolLessBusy = buildPool( + WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyLessBusyPoolOption ) const dynamicClusterPoolWeightedRoundRobin = buildPool( + WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyWeightedRoundRobinPoolOption ) const dynamicClusterPoolFairShare = buildPool( + WorkerTypes.CLUSTER, PoolTypes.DYNAMIC, poolSize, - WorkerTypes.CLUSTER, workerChoiceStrategyFairSharePoolOption ) @@ -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,