This is a wasm32 browser friendly version of easybench
A lightweight benchmarking library which:
- uses linear regression to screen off sources of constant error;
- handles benchmarks which must mutate some state;
- has a very simple API!
use console; use ; // Simple benchmarks are performed with `bench`. log_1; log_1; // If a function needs to mutate some state, use `bench_env`. log_1; log_1;
Running the above yields the following:
fib 200: 38 ns (R²=1.000, 26053498 iterations in 155 samples) fib 500: 109 ns (R²=1.000, 9131585 iterations in 144 samples) reverse: 3 ns (R²=0.998, 23684997 iterations in 154 samples) sort: 3 ns (R²=0.999, 23684997 iterations in 154 samples)
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.