perf: cleanup benchmark code
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 23 Jul 2023 19:16:24 +0000 (21:16 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 23 Jul 2023 19:16:24 +0000 (21:16 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
benchmarks/internal/bench.mjs

index 48f30f66d0f47a14b1296b1279ebbee679309eb7..8235d5727b9e0043c0948fd4dfbbb8249a57e05c 100644 (file)
@@ -20,26 +20,24 @@ for (const poolType of Object.values(PoolTypes)) {
       for (const enableTasksQueue of [false, true]) {
         if (workerChoiceStrategy === WorkerChoiceStrategies.FAIR_SHARE) {
           for (const measurement of [Measurements.runTime, Measurements.elu]) {
-            const pool = buildPool(workerType, poolType, poolSize, {
-              workerChoiceStrategy,
-              workerChoiceStrategyOptions: {
-                measurement
-              },
-              enableTasksQueue
-            })
             pools.push([
               `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}|measurement:${measurement}`,
-              pool
+              buildPool(workerType, poolType, poolSize, {
+                workerChoiceStrategy,
+                workerChoiceStrategyOptions: {
+                  measurement
+                },
+                enableTasksQueue
+              })
             ])
           }
         } else {
-          const pool = buildPool(workerType, poolType, poolSize, {
-            workerChoiceStrategy,
-            enableTasksQueue
-          })
           pools.push([
             `${poolType}|${workerType}|${workerChoiceStrategy}|tasks queue:${enableTasksQueue}`,
-            pool
+            buildPool(workerType, poolType, poolSize, {
+              workerChoiceStrategy,
+              enableTasksQueue
+            })
           ])
         }
       }