A karma-benchmark example
This is a simple example that shows how to use karma-benchmark
with the karma-benchmark-reporter
and karma-junit-reporter
reporters.
It pits native Array methods against a home-made utility library.
First, install dependencies:
npm install
This will run benchmarks in Chrome and Firefox:
grunt bench
You can pass chrome
or firefox
.
grunt bench:chrome
Grunt is not required. You can simply run Karma directly:
karma start
This will run benchmarks in PhantomJS and write test results to results/junit-benchmark-results.xml
:
grunt bench:ci