mitata
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published

mitata

cross-runtime benchmarking lib


Install

bun add mitata

npm install mitata

Example

import { run, bench, group, baseline } from 'mitata';

// deno
// import { ... } from 'npm:mitata';

// d8/jsc
// import { ... } from '<path to mitata>/src/cli.mjs';

bench('noop', () => {});
bench('noop2', () => {});

group('group', () => {
  baseline('baseline', () => {});
  bench('Date.now()', () => Date.now());
  bench('performance.now()', () => performance.now());
});

group({ name: 'group2', summary: false }, () => {
  bench('new Array(0)', () => new Array(0));
  bench('new Array(1024)', () => new Array(1024));
});

await run({
  units: false, // print small units cheatsheet
  silent: false, // enable/disable stdout output
  avg: true, // enable/disable avg column (default: true)
  json: false, // enable/disable json output (default: false)
  colors: true, // enable/disable colors (default: true)
  min_max: true, // enable/disable min/max column (default: true)
  percentiles: false, // enable/disable percentiles column (default: true)
});

License

MIT © Evan

Dependents (4)

Package Sidebar

Install

npm i mitata

Weekly Downloads

5,264

Version

0.1.11

License

MIT

Unpacked Size

27 kB

Total Files

14

Last publish

Collaborators

  • evan