build(deps-dev): apply updates
[benchmarks-js.git] / min.mjs
diff --git a/min.mjs b/min.mjs
index 2ac02b52bb9b9a0a4972b3a307779a11c4d5e343..858b1eb3fc9c7e5d4b4cc456f1925b9f9205ce6b 100644 (file)
--- a/min.mjs
+++ b/min.mjs
@@ -1,4 +1,5 @@
-import Benchmark from 'benny'
+import { bench, group, run } from 'tatami-ng'
+
 import { generateRandomNumberArray } from './benchmark-utils.mjs'
 
 const size = 10000
@@ -47,28 +48,24 @@ function sortMin (values) {
   return values.sort((a, b) => a - b)[0]
 }
 
-Benchmark.suite(
-  `Min from ${size} numbers`,
-  Benchmark.add('Math.min', () => {
+group(`Min from ${size} numbers`, () => {
+  bench('Math.min', () => {
     Math.min(...testArray)
-  }),
-  Benchmark.add('loopMin', () => {
+  })
+  bench('loopMin', () => {
     loopMin(testArray)
-  }),
-  Benchmark.add('reduceTernaryMin', () => {
+  })
+  bench('reduceTernaryMin', () => {
     reduceTernaryMin(testArray)
-  }),
-  Benchmark.add('reduceMath.min', () => {
+  })
+  bench('reduceMathMin', () => {
     reduceMathMin(testArray)
-  }),
-  Benchmark.add('sortMin', () => {
+  })
+  bench('sortMin', () => {
     sortMin(testArray)
-  }),
-  Benchmark.cycle(),
-  Benchmark.complete(),
-  Benchmark.save({ file: 'min', format: 'json', details: true }),
-  Benchmark.save({ file: 'min', format: 'chart.html', details: true }),
-  Benchmark.save({ file: 'min', format: 'table.html', details: true })
-).catch((err) => {
-  console.error(err)
+  })
+})
+
+await run({
+  units: true
 })