chore: v2.4.8
[poolifier.git] / benchmarks / internal / cluster / dynamic.js
index 105bbdaa9d77eef540cfa361e6d794095b400363..475ba9d79b953fdfabf075010d94ddb979fe93eb 100644 (file)
@@ -13,11 +13,18 @@ const dynamicPool = new DynamicClusterPool(
   './benchmarks/internal/cluster/worker.js'
 )
 
-const dynamicPoolLessRecentlyUsed = new DynamicClusterPool(
+const dynamicPoolLessUsed = new DynamicClusterPool(
   size / 2,
   size * 3,
   './benchmarks/internal/cluster/worker.js',
-  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
+  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
+)
+
+const dynamicPoolLessBusy = new DynamicClusterPool(
+  size / 2,
+  size * 3,
+  './benchmarks/internal/cluster/worker.js',
+  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
 )
 
 const dynamicPoolWeightedRoundRobin = new DynamicClusterPool(
@@ -40,10 +47,16 @@ async function dynamicClusterTest (
   return runPoolifierTest(dynamicPool, { tasks, workerData })
 }
 
-async function dynamicClusterTestLessRecentlyUsed (
+async function dynamicClusterTestLessUsed (
+  { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+  return runPoolifierTest(dynamicPoolLessUsed, { tasks, workerData })
+}
+
+async function dynamicClusterTestLessBusy (
   { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
 ) {
-  return runPoolifierTest(dynamicPoolLessRecentlyUsed, { tasks, workerData })
+  return runPoolifierTest(dynamicPoolLessBusy, { tasks, workerData })
 }
 
 async function dynamicClusterTestWeightedRoundRobin (
@@ -60,7 +73,8 @@ async function dynamicClusterTestFairShare (
 
 module.exports = {
   dynamicClusterTest,
-  dynamicClusterTestLessRecentlyUsed,
+  dynamicClusterTestLessUsed,
+  dynamicClusterTestLessBusy,
   dynamicClusterTestWeightedRoundRobin,
   dynamicClusterTestFairShare
 }