Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DylanPiercey/benchmark-cli
🏋️♀️ CLI application to benchmark JavaScript files.
https://github.com/DylanPiercey/benchmark-cli
Last synced: 3 months ago
JSON representation
🏋️♀️ CLI application to benchmark JavaScript files.
- Host: GitHub
- URL: https://github.com/DylanPiercey/benchmark-cli
- Owner: DylanPiercey
- Created: 2017-08-03T01:47:43.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T02:04:58.000Z (over 7 years ago)
- Last Synced: 2024-07-20T08:28:43.381Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
benchmark-cli
Quickly run some benchmarks from the CLI.
Supports requiring dependencies and uses [benchmark.js](https://benchmarkjs.com) internally.# Installation
```console
npm install benchmark-cli -g
```# Examples
### Single file
```console
$ benchmark ./test/example1.js
✔ example1 x 83,285 ops/sec ±0.83% (86 runs sampled)
```### Glob of files
```console
$ 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
```console
$ benchmark -e "for (var i = 1000; i--;);"
✔ eval-1 x 244,076 ops/sec ±1.17% (86 runs sampled)
```### Evaluate multiple scripts
```console
$ 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!