A CLI tool to benchmark javascript files
main.js
let arr_1 = new Array(256);
let arr_2 = new Array(256);
// @jsbm { concat }
arr_1.concat(arr_2);
// @jsbm { spread }
[...arr_1, ...arr_2];
usage
$ jsbm -i 1000 main.js
concat | 485μs (std. 6μs o. 39%)
spread | 1.42ms (std. 12μs o. 10%)
jsbm [options] [paths]...
options:
-i, --iterations
Measure snippets over x iterations (defaults to 1)
-s, --samples
Repeat x measurements (defaults to 1000)
--keep
Keep generated files
cargo install --git https://github.com/9elt/jsbm
see: installing binaries with cargo install, install rust and cargo