build(deps-dev): apply updates
[poolifier.git] / benchmarks / worker-selection / round-robin.mjs
index c9366262f0e87d6908d7c4bc4045dbddd1cca15e..64ea78da719cf0ef0607bfa4f8e27cb0e4977388 100644 (file)
@@ -1,5 +1,10 @@
-import { bench, group, run } from 'mitata'
+import { bench, group, run } from 'tatami-ng'
 
+/**
+ *
+ * @param numberOfWorkers
+ * @returns
+ */
 function generateWorkersArray (numberOfWorkers) {
   return [...Array(numberOfWorkers).keys()]
 }
@@ -8,12 +13,18 @@ const workers = generateWorkersArray(60)
 
 let nextWorkerIndex
 
+/**
+ * @returns
+ */
 function roundRobinTernaryOffByOne () {
   nextWorkerIndex =
     workers.length - 1 === nextWorkerIndex ? 0 : nextWorkerIndex + 1
   return workers[nextWorkerIndex]
 }
 
+/**
+ * @returns
+ */
 function roundRobinTernaryWithNegation () {
   nextWorkerIndex =
     !nextWorkerIndex || workers.length - 1 === nextWorkerIndex
@@ -22,6 +33,9 @@ function roundRobinTernaryWithNegation () {
   return workers[nextWorkerIndex]
 }
 
+/**
+ * @returns
+ */
 function roundRobinTernaryWithPreChoosing () {
   const chosenWorker = workers[nextWorkerIndex]
   nextWorkerIndex =
@@ -29,6 +43,9 @@ function roundRobinTernaryWithPreChoosing () {
   return chosenWorker
 }
 
+/**
+ * @returns
+ */
 function roundRobinIncrementModulo () {
   const chosenWorker = workers[nextWorkerIndex]
   nextWorkerIndex++