-import { bench, group, run } from 'mitata'
+import { bench, group, run } from 'tatami-ng'
+/**
+ *
+ * @param numberOfWorkers
+ * @returns
+ */
function generateWorkersArray (numberOfWorkers) {
return [...Array(numberOfWorkers).keys()]
}
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
return workers[nextWorkerIndex]
}
+/**
+ * @returns
+ */
function roundRobinTernaryWithPreChoosing () {
const chosenWorker = workers[nextWorkerIndex]
nextWorkerIndex =
return chosenWorker
}
+/**
+ * @returns
+ */
function roundRobinIncrementModulo () {
const chosenWorker = workers[nextWorkerIndex]
nextWorkerIndex++