-import Benchmark from 'benny'
+import { bench, group, run } from 'tatami-ng'
function generateWorkersArray (numberOfWorkers) {
return [...Array(numberOfWorkers).keys()]
return chosenWorker
}
-Benchmark.suite(
- 'Round robin tasks distribution',
- Benchmark.add('Ternary off by one', () => {
+group('Round robin tasks distribution', () => {
+ bench('Ternary off by one', () => {
nextWorkerIndex = 0
roundRobinTernaryOffByOne()
- }),
- Benchmark.add('Ternary with negation', () => {
+ })
+ bench('Ternary with negation', () => {
nextWorkerIndex = 0
roundRobinTernaryWithNegation()
- }),
- Benchmark.add('Ternary with pre-choosing', () => {
+ })
+ bench('Ternary with pre-choosing', () => {
nextWorkerIndex = 0
roundRobinTernaryWithPreChoosing()
- }),
- Benchmark.add('Increment+Modulo', () => {
+ })
+ bench('Increment+Modulo', () => {
nextWorkerIndex = 0
roundRobinIncrementModulo()
- }),
- Benchmark.cycle(),
- Benchmark.complete()
-)
+ })
+})
+
+await run({ units: true })