build(deps-dev): apply updates
[benchmarks-js.git] / quick-select.mjs
index a829a9e52032966d969338efcbd1ddc56d08a495..49dc7057b5c70d30ad5894169cabfd02df409516 100644 (file)
@@ -1,6 +1,6 @@
 import { randomInt } from 'node:crypto'
 
-import Benchmark from 'benny'
+import { bench, group, run } from 'tatami-ng'
 
 /**
  * @param numberOfWorkers
@@ -228,41 +228,27 @@ function quickSelectRecursionRandomPivot (tasksMap) {
   )
 }
 
-Benchmark.suite(
-  'Quick select',
-  Benchmark.add('Loop select', () => {
+group('Quick select', () => {
+  bench('Loop select', () => {
     loopSelect(tasksMap)
-  }),
-  Benchmark.add('Array sort select', () => {
+  })
+  bench('Array sort select', () => {
     arraySortSelect(tasksMap)
-  }),
-  Benchmark.add('Quick select loop', () => {
+  })
+  bench('Quick select loop', () => {
     quickSelectLoop(tasksMap)
-  }),
-  Benchmark.add('Quick select loop with random pivot', () => {
+  })
+  bench('Quick select loop with random pivot', () => {
     quickSelectLoopRandomPivot(tasksMap)
-  }),
-  Benchmark.add('Quick select recursion', () => {
+  })
+  bench('Quick select recursion', () => {
     quickSelectRecursion(tasksMap)
-  }),
-  Benchmark.add('Quick select recursion with random pivot', () => {
+  })
+  bench('Quick select recursion with random pivot', () => {
     quickSelectRecursionRandomPivot(tasksMap)
-  }),
-  Benchmark.cycle(),
-  Benchmark.complete(),
-  Benchmark.save({
-    file: 'quick-select',
-    format: 'json',
-    details: true
-  }),
-  Benchmark.save({
-    file: 'quick-select',
-    format: 'chart.html',
-    details: true
-  }),
-  Benchmark.save({
-    file: 'quick-select',
-    format: 'table.html',
-    details: true
   })
-).catch(console.error)
+})
+
+await run({
+  units: true
+})