benchmark-cli

1.1.0 • Public • Published


benchmark-cli
API stability Standard NPM version Downloads

Quickly run some benchmarks from the CLI. Supports requiring dependencies and uses benchmark.js internally.

Installation

npm install benchmark-cli -g

Examples

Single file

$ benchmark ./test/example1.js
✔ example1 x 83,285 ops/sec ±0.83% (86 runs sampled)

Glob of files

$ benchmark ./test/*.js
✔ example1 x 84,518 ops/sec ±0.90% (87 runs sampled)
✔ example2 x 1,612,805 ops/sec ±1.81% (80 runs sampled)

Evaluate script

$ benchmark -e "for (var i = 1000; i--;);"
✔ eval-1 x 244,076 ops/sec ±1.17% (86 runs sampled)

Evaluate multiple scripts

$ benchmark -e "1 + 1" -e "1 + 2"
✔ eval-1 x 1,561,524 ops/sec ±2.24% (77 runs sampled)
✔ eval-2 x 1,633,941 ops/sec ±1.76% (82 runs sampled)

Contributions

Please feel free to create a PR!

Package Sidebar

Install

npm i benchmark-cli

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dylanpiercey