Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@feltmaps/benchmarking

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feltmaps/benchmarking

A benchmarking tool for JS code

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Felt benchmarking

This package allows to benchmark javascript code on the browser.

How it works

Runs Benchmark implementations and measures the time it takes to execute a single run. If that run takes less than 5ms (which is the minimum resolution of performance.now(), see Performance.now() on MDN), we keep incrementing the number of iterations iterationsPerSample per run until it takes more than 5ms. Once that happens, we capture 210 samples via running iterationsPerSample iterations per sample

Create a benchmark

export default class FilterCreate extends Benchmark {
  bench() {
    findPrimes(1000);
  }
}

Create a benchmark suite

const suite = new BenchmarkingSuite();

Add benchmarks to the suite

suite.register("Filter", "version 1", new FilterCreate());

Adding multiple benchmarks with the same name but different version will compare them in the results website

suite.register("Filter", "version 1", new FilterCreate());
suite.register("Filter", "version 2", new FilterCreate2());

Run the suite

suite.run();

See index.html and benchmarks.ts for website and js code examples

Results

Results show a statistics table, a plot with various statistics (quartiles, median, mean, trimmed mean) and a regression plot.

The correlation in the table should be almost 1, if it's less than 0.99 a ⚠️ sign is shown. If correlation is less than 0.9 a ☠ sign is shown because results are not valid.

alt text

Based on Maplibre's benchmarking tool

FAQs

Package last updated on 16 Nov 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc