Hit the mark with your benchmarks. https://riveragroup.github.io/benchmarksman/

Kyle P Davis 069547e463 ignore node_modules/ for jshint 10 years ago
example a1357cfd2a add arrayIndexOf example 10 years ago
lib ca6f250aea fix ctx issue in runner 10 years ago
test caa5ec81cb fix up pkg for running benchmarks and tests 10 years ago
.gitignore a91e7cbb78 clean .gitignore 10 years ago
.jshintignore 069547e463 ignore node_modules/ for jshint 10 years ago
.jshintrc bf71fae413 tweak jshint config 10 years ago
README.md 44875e315b update README w/ playground link, fix mocha link 10 years ago
benchmarksman.js caa5ec81cb fix up pkg for running benchmarks and tests 10 years ago
main.js 5429138db4 misc jsdocs 10 years ago
package.json 2349287d06 fix pkg json, add cmds for browserify and webpack 10 years ago

README.md

benchmarksman

A handy wrapper around benchmark.js to make writing benchmarks as easy as writing test cases (in mocha via the exports UI).

Why

Using benchmark.js directly can be a little tedious if you just want it to get the ops/sec for a bunch of different code snippets.

Usage

Below are some of the ways to use benchmarksman in your project.

If instant gratification is your thing, then get your fix with a live demo and run some quick benchmarks on the playground site.

Command Line

benchmarksman bench/array.js

Programmatic

exports.Date = {
	"#getTime()": function(){
		new Date().getTime();
	},
	".now()": function(){
		Date.now();
	}
};
if (!module.main) require("benchmarksman").runner(exports);

Output

Date #getTime() x 7,705,532 ops/sec ±2.95% (94 runs sampled)
Date .now() x 15,132,312 ops/sec ±1.85% (94 runs sampled)