Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Latest commit

 

History

History
67 lines (55 loc) · 2.47 KB

README.md

File metadata and controls

67 lines (55 loc) · 2.47 KB

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

  • Node.js 8+

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 [email protected]:Leko/zapshot.git
cd zapshot
npm i
npm run bootstrap

License

This package under MIT license.