Leko / zapshot

:zap: JavaScript benchmarking tool to help continuous performance optimization
MIT License
5 stars 1 forks source link

zapshot

Greenkeeper badge npm license CircleCI codecov

JavaScript benchmarking tool.

zapshot is compare diff between before execution and after rather than find fastest function. To help performance optimization in your products continuously.

Please refer examples to help you to understand out concept.

zapshot

Install

npm i -g zapshot-cli

Requirement

Usage

$ zapshot --help
Options:
  --help           Show help                                           [boolean]
  --version        Show version number                                 [boolean]
  --init           Create initial metrics                              [boolean]
  --cache          Path of before metrics
                                           [string] [default: "./.zapshotcache"]
  --quiet, -q      Report only summary                [boolean] [default: false]
  --threshold, -t  Percentage of least significant difference (LSD)
                                                          [number] [default: 20]
  --step           Specify the number of iteration on each benchmark
                                                          [number] [default: 50]

Basic usage

zapshot --init benchmark.js # Create snapshot
# some optimization
zapshot benchmark.js # Compare with snapshot

If you want to update snapshots, please re-run zapshot --init benchmark.js.

Contribution

  1. Fork this repo
  2. Create your branch like fix-hoge-foo-bar add-hige
  3. Write your code
  4. Pass all checks (npm run lint && npm run flow && npm test)
  5. Commit with gitmoji
  6. Submit pull request to master branch

Development

git clone git@github.com:Leko/zapshot.git
cd zapshot
npm i
npm run bootstrap

License

This package under MIT license.