Socket
Socket
Sign inDemoInstall

tiny-benchy

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tiny-benchy

A tiny benchmarking utility


Version published
Weekly downloads
48
increased by11.63%
Maintainers
1
Install size
14.4 kB
Created
Weekly downloads
 

Readme

Source

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;

FAQs

Last updated on 05 Jul 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc