Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        





benchmark-cli



API stability



Standard



NPM version



Downloads

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!