Microbenchmarks that (in)validate CreednGo rules.
This repository is a NPM project configured with the Mitata benchmarking framework.
Rules often suggest an alternative way of writing small pieces of code. Measuring the effect of a small and isolated amount of code is hard, we need to be cautious. See Mitata doc - writing good benchmarks, and many others.
To run or create benchmarks, you need NodeJS (or another compatible JS runtime).
- Create a new mjs file in
microbenchs. - Create some functions to test. Use mitata's
benchto configure the benchmark,boxplotto get a graphical output, andrunto execute the benchmark. Seeexample.mjs.
Use the bench.sh script, which is a wrapper around the JMH jar file.
Run ./bench.sh -h too see the available JMH options.
To run a single benchmark file:
npm run benc -- path/to/file.mjsExample:
npm run benc -- microbenchmarks/example.mjsThe benchmark results are printed to stdout. Please read mitata's README for more information about the benchmark tool.