refactor: remove blank line
[poolifier.git] / benchmarks / internal / bench.mjs
index 48f30f66d0f47a14b1296b1279ebbee679309eb7..193827f3a24da416f58e079dd8cd546c8b50d8cd 100644 (file)
@@ -6,7 +6,7 @@ import {
   WorkerTypes,
   availableParallelism
 } from '../../lib/index.mjs'
-import { WorkerFunctions } from '../benchmarks-types.mjs'
+import { TaskFunctions } from '../benchmarks-types.mjs'
 import { buildPool, runTest } from '../benchmarks-utils.mjs'
 
 const poolSize = availableParallelism()
@@ -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
+            })
           ])
         }
       }
@@ -49,10 +47,10 @@ for (const poolType of Object.values(PoolTypes)) {
 
 const taskExecutions = 1
 const workerData = {
-  function: WorkerFunctions.jsonIntegerSerialization,
+  function: TaskFunctions.jsonIntegerSerialization,
   taskSize: 1000
 }
-const addPools = pools =>
+const addPools = (pools) =>
   pools.map(([name, pool]) => {
     return add(name, async () => {
       await runTest(pool, {
@@ -92,4 +90,4 @@ suite(
     // eslint-disable-next-line n/no-process-exit
     return process.exit()
   })
-  .catch(err => console.error(err))
+  .catch((err) => console.error(err))