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.
npm i -g zapshot-cli
- Node.js 8+
$ 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]
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
.
- Fork this repo
- Create your branch like
fix-hoge-foo-bar
add-hige
- Write your code
- Pass all checks (
npm run lint && npm run flow && npm test
) - Commit with gitmoji
- Submit pull request to
master
branch
git clone [email protected]:Leko/zapshot.git
cd zapshot
npm i
npm run bootstrap
This package under MIT license.