perf: switch to mitata
[benchmarks-js.git] / uuid-generator.mjs
index 0b4c9fbc59fb29df8ebd7cb7412ea980b41a537e..050a0db4b16ff6e0b851363d97c5866c2cd40e8b 100644 (file)
@@ -1,31 +1,17 @@
 import { randomUUID } from 'node:crypto'
 
-import Benchmark from 'benny'
+import { bench, group, run } from 'mitata'
 import { v4 as uuid } from 'uuid'
 
-Benchmark.suite(
-  'UUIDv4 generator',
-  Benchmark.add('crypto randomUUID', () => {
+group('UUIDv4 generator', () => {
+  bench('randomUUID', () => {
     randomUUID()
-  }),
-  Benchmark.add('uuid', () => {
+  })
+  bench('uuid', () => {
     uuid()
-  }),
-  Benchmark.cycle(),
-  Benchmark.complete(),
-  Benchmark.save({
-    file: 'uuid-generator',
-    format: 'json',
-    details: true
-  }),
-  Benchmark.save({
-    file: 'uuid-generator',
-    format: 'chart.html',
-    details: true
-  }),
-  Benchmark.save({
-    file: 'uuid-generator',
-    format: 'table.html',
-    details: true
   })
-).catch(console.error)
+})
+
+await run({
+  units: true
+})