If we want to know more about benchmark comparison, there is no better library than Criterion. It will generate statistics that you can use to compare benchmarks from multiple commits, and not only that, it will also enable you to show plots if you have gnuplot installed. It requires Rust nightly to run.
Let's see how to use it. First, you will need to add Criterion as a dependency in your Cargo.toml file and create a benchmarks file:
[dev-dependencies] criterion = "0.1.1" [[bench]] name = "example" harness = false
Then, you will need to create a benchmark. I will be using the Fibonacci function that we saw earlier to demonstrate the behavior. The way to declare the benchmarks is almost exactly the same ...