tiny-benchy
A tiny benchmarking utility
Last updated 5 years ago by jasperdm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tiny-benchy 
SYNC missed versions from official npm registry.

Benchy

A tiny benchmarking utility that helps run benchmarks quickly.

Supports callback functions which return a promise.

Usage

const { Benchmark } = require("tiny-benchy");
const suite = new Benchmark();

suite.add("RegExp#test-async", async () => {
  /o/.test("Hello World!");
});

suite.add("RegExp#test", () => {
  /o/.test("Hello World!");
});

suite.run();

Output

rank 1:  RegExp#test-async 1,033,057.85 opts/sec (mean: 968ns, stddev: 0.002ms, 50 samples)
rank 2:  RegExp#test 552,486.19 opts/sec (mean: 0.002ms, stddev: 0.005ms, 50 samples)

API

declare class Benchmark {
  constructor(iterations?: number);
  add(
    title: string,
    callback: () => void | Promise<void>,
    iterations?: number
  ): void;
  run(): Promise<void>;
}

export = Benchmark;

Current Tags

  • 2.1.0                                ...           latest (5 years ago)

5 Versions

  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 5
Last Day 0
Last Week 4
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE