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

benchrunner

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

benchrunner

Benchmark Suite Runner for benchmark.js

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Benchmark Suite Runner for benchmark.js

Installation

npm

npm install benchrunner

Bower

bower install benchrunner

Usage

You can write a suite like this:

(function(root) {

    var suites = root.benchrunner.suites;;

    suites.push(Benchmark.Suite('trim')
        .add('String.replace', function() {
            '   foo   '.replace(/^\s+|\s+$/g, '');
        })
        .add('String.trim', function() {
            '   foo   '.trim();
        })
    );

}(typeof global == 'object' && global || this));

Now you can run them from CLI or in the browser really easy:

CLI

Currently only PhantomJS is supported.

phantomjs benchrunner.js suite1.js suite2.js

From the root of your project, that would become e.g.:

phantomjs ./node_modules/benchrunner/benchrunner.js benchmarks/my-suite.js

Or, if you install globally (i.e. npm install -g benchrunner):

benchrunner benchmarks/my-suite.js

Browser

Just point your browser at the runner page, e.g.

http://localhost/your-project/benchmarks/index.html

See examples/basic.html for an example (you need to include a few scripts).

Examples

  • Examples in this repository.
  • jQuery Evergreen (run)

Credits

Heavily inspired by Lo-Dash's benchmark suite runner.

License

MIT licensed

Keywords

FAQs

Package last updated on 19 Nov 2014

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