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

Kyle P Davis 45b117911f rename example to make it even more obvious what it is testing 11 年之前
example 45b117911f rename example to make it even more obvious what it is testing 11 年之前
lib 226b527995 EAGLESIX-3880: add test, arrayExtend example, jscs, styling 11 年之前
test 226b527995 EAGLESIX-3880: add test, arrayExtend example, jscs, styling 11 年之前
.gitignore 1575e2f07a add .c9/ to git ignores list 11 年之前
.jscsrc 7bbc2867a5 jscs rule to require space after comma 11 年之前
.jshintignore 069547e463 ignore node_modules/ for jshint 11 年之前
.jshintrc bf71fae413 tweak jshint config 11 年之前
README.md 226b527995 EAGLESIX-3880: add test, arrayExtend example, jscs, styling 11 年之前
benchmarksman.js caa5ec81cb fix up pkg for running benchmarks and tests 11 年之前
main.js 226b527995 EAGLESIX-3880: add test, arrayExtend example, jscs, styling 11 年之前
package.json edf7614c03 fix up pkg json info 11 年之前

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.dateGetTime = {

	"#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)