docs: update changelog entries
[poolifier.git] / benchmarks / internal / thread / fixed.js
index 376352376d4bbb3f4636d2dc4baca2cdeaf91ba2..a4ba580e0210710915e184abaeb6951caf1c6fd2 100644 (file)
@@ -2,7 +2,7 @@ const {
   FixedThreadPool,
   WorkerChoiceStrategies
 } = require('../../../lib/index')
-const { runPoolifierTest } = require('../benchmark-utils')
+const { runPoolifierTest } = require('../../benchmarks-utils')
 
 const size = 30
 const numberOfTasks = 1
@@ -12,10 +12,16 @@ const fixedPool = new FixedThreadPool(
   './benchmarks/internal/thread/worker.js'
 )
 
-const fixedPoolLessRecentlyUsed = new FixedThreadPool(
+const fixedPoolLessUsed = new FixedThreadPool(
   size,
   './benchmarks/internal/thread/worker.js',
-  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_RECENTLY_USED }
+  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
+)
+
+const fixedPoolLessBusy = new FixedThreadPool(
+  size,
+  './benchmarks/internal/thread/worker.js',
+  { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
 )
 
 const fixedPoolWeightedRoundRobin = new FixedThreadPool(
@@ -36,10 +42,16 @@ async function fixedThreadTest (
   return runPoolifierTest(fixedPool, { tasks, workerData })
 }
 
-async function fixedThreadTestLessRecentlyUsed (
+async function fixedThreadTestLessUsed (
+  { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
+) {
+  return runPoolifierTest(fixedPoolLessUsed, { tasks, workerData })
+}
+
+async function fixedThreadTestLessBusy (
   { tasks, workerData } = { tasks: numberOfTasks, workerData: { proof: 'ok' } }
 ) {
-  return runPoolifierTest(fixedPoolLessRecentlyUsed, { tasks, workerData })
+  return runPoolifierTest(fixedPoolLessBusy, { tasks, workerData })
 }
 
 async function fixedThreadTestWeightedRoundRobin (
@@ -56,7 +68,8 @@ async function fixedThreadTestFairShare (
 
 module.exports = {
   fixedThreadTest,
-  fixedThreadTestLessRecentlyUsed,
+  fixedThreadTestLessUsed,
+  fixedThreadTestLessBusy,
   fixedThreadTestWeightedRoundRobin,
   fixedThreadTestFairShare
 }