refactor: cleanup enums namespace
[poolifier.git] / benchmarks / internal / bench.js
index 4663d9c42bf2f27f38b78cb417acbe96bf6f2e86..627bd0ed48d6e12f3c6ecda13ed3aad0a88990ba 100644 (file)
@@ -17,11 +17,11 @@ const tasksQueuePoolOption = { enableTasksQueue: true }
 const workerChoiceStrategyRoundRobinPoolOption = {
   workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN
 }
-const workerChoiceStrategyLessUsedPoolOption = {
-  workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED
+const workerChoiceStrategyLeastUsedPoolOption = {
+  workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED
 }
-const workerChoiceStrategyLessBusyPoolOption = {
-  workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY
+const workerChoiceStrategyLeastBusyPoolOption = {
+  workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY
 }
 const workerChoiceStrategyWeightedRoundRobinPoolOption = {
   workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
@@ -31,169 +31,169 @@ const workerChoiceStrategyFairSharePoolOption = {
 }
 
 const fixedThreadPoolRoundRobin = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyRoundRobinPoolOption
 )
 
 const fixedThreadPoolRoundRobinTasksQueue = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
   { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption }
 )
 
-const fixedThreadPoolLessUsed = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+const fixedThreadPoolLeastUsed = buildPool(
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const fixedThreadPoolLessBusy = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+const fixedThreadPoolLeastBusy = buildPool(
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const fixedThreadPoolWeightedRoundRobin = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyWeightedRoundRobinPoolOption
 )
 
 const fixedThreadPoolFairShare = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyFairSharePoolOption
 )
 
 const fixedThreadPoolFairShareTasksQueue = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.FIXED,
+  WorkerTypes.thread,
+  PoolTypes.fixed,
   poolSize,
   { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption }
 )
 
 const dynamicThreadPoolRoundRobin = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyRoundRobinPoolOption
 )
 
-const dynamicThreadPoolLessUsed = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.DYNAMIC,
+const dynamicThreadPoolLeastUsed = buildPool(
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const dynamicThreadPoolLessBusy = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.DYNAMIC,
+const dynamicThreadPoolLeastBusy = buildPool(
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const dynamicThreadPoolWeightedRoundRobin = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyWeightedRoundRobinPoolOption
 )
 
 const dynamicThreadPoolFairShare = buildPool(
-  WorkerTypes.THREAD,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.thread,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyFairSharePoolOption
 )
 
 const fixedClusterPoolRoundRobin = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyRoundRobinPoolOption
 )
 
 const fixedClusterPoolRoundRobinTasksQueue = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
   { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption }
 )
 
-const fixedClusterPoolLessUsed = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+const fixedClusterPoolLeastUsed = buildPool(
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const fixedClusterPoolLessBusy = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+const fixedClusterPoolLeastBusy = buildPool(
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const fixedClusterPoolWeightedRoundRobin = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyWeightedRoundRobinPoolOption
 )
 
 const fixedClusterPoolFairShare = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
   workerChoiceStrategyFairSharePoolOption
 )
 
 const fixedClusterPoolFairShareTaskQueue = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.FIXED,
+  WorkerTypes.cluster,
+  PoolTypes.fixed,
   poolSize,
   { ...workerChoiceStrategyFairSharePoolOption, ...tasksQueuePoolOption }
 )
 
 const dynamicClusterPoolRoundRobin = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyRoundRobinPoolOption
 )
 
-const dynamicClusterPoolLessUsed = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.DYNAMIC,
+const dynamicClusterPoolLeastUsed = buildPool(
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const dynamicClusterPoolLessBusy = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.DYNAMIC,
+const dynamicClusterPoolLeastBusy = buildPool(
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const dynamicClusterPoolWeightedRoundRobin = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyWeightedRoundRobinPoolOption
 )
 
 const dynamicClusterPoolFairShare = buildPool(
-  WorkerTypes.CLUSTER,
-  PoolTypes.DYNAMIC,
+  WorkerTypes.cluster,
+  PoolTypes.dynamic,
   poolSize,
   workerChoiceStrategyFairSharePoolOption
 )
@@ -218,14 +218,14 @@ Benchmark.suite(
       })
     }
   ),
-  Benchmark.add('Fixed:ThreadPool:LessUsed', async () => {
-    await runTest(fixedThreadPoolLessUsed, {
+  Benchmark.add('Fixed:ThreadPool:LeastUsed', async () => {
+    await runTest(fixedThreadPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Fixed:ThreadPool:LessBusy', async () => {
-    await runTest(fixedThreadPoolLessBusy, {
+  Benchmark.add('Fixed:ThreadPool:LeastBusy', async () => {
+    await runTest(fixedThreadPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -257,14 +257,14 @@ Benchmark.suite(
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ThreadPool:LessUsed', async () => {
-    await runTest(dynamicThreadPoolLessUsed, {
+  Benchmark.add('Dynamic:ThreadPool:LeastUsed', async () => {
+    await runTest(dynamicThreadPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ThreadPool:LessBusy', async () => {
-    await runTest(dynamicThreadPoolLessBusy, {
+  Benchmark.add('Dynamic:ThreadPool:LeastBusy', async () => {
+    await runTest(dynamicThreadPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -296,14 +296,14 @@ Benchmark.suite(
       })
     }
   ),
-  Benchmark.add('Fixed:ClusterPool:LessUsed', async () => {
-    await runTest(fixedClusterPoolLessUsed, {
+  Benchmark.add('Fixed:ClusterPool:LeastUsed', async () => {
+    await runTest(fixedClusterPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Fixed:ClusterPool:LessBusy', async () => {
-    await runTest(fixedClusterPoolLessBusy, {
+  Benchmark.add('Fixed:ClusterPool:LeastBusy', async () => {
+    await runTest(fixedClusterPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -335,14 +335,14 @@ Benchmark.suite(
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ClusterPool:LessUsed', async () => {
-    await runTest(dynamicClusterPoolLessUsed, {
+  Benchmark.add('Dynamic:ClusterPool:LeastUsed', async () => {
+    await runTest(dynamicClusterPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ClusterPool:LessBusy', async () => {
-    await runTest(dynamicClusterPoolLessBusy, {
+  Benchmark.add('Dynamic:ClusterPool:LeastBusy', async () => {
+    await runTest(dynamicClusterPoolLeastBusy, {
       taskExecutions,
       workerData
     })