perf: add tasks queue to more benchmark
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 19 Apr 2023 18:09:31 +0000 (20:09 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 19 Apr 2023 18:09:31 +0000 (20:09 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
benchmarks/internal/bench.js

index d615f66ea3d83a68c7b787e4ddb52395b1587b27..4663d9c42bf2f27f38b78cb417acbe96bf6f2e86 100644 (file)
@@ -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,