The Criterion benchmarking library for Rust is documented as generating plots describing the benchmark results:
Criterion.rs can generate a number of useful charts and graphs which you can check to get a better understanding of the behavior of the benchmark.
The plots and saved data are stored under
target/criterion/$BENCHMARK_NAME/.
However, after running cargo bench and seeing Criterion's output on the terminal, I don't see a directory named target/criterion/. Where is the output now, or what do I have to do to activate it?
This was a small bug (criterion issue #192): when Criterion is used in a Cargo workspace, it doesn't find the workspace's
targetdirectory, and ends up writing its results to<individual crate directory>/target/criterioninstead.The Cargo extension cargo-criterion was supposed to work around this but unfortunately for my particular case, currently didn't work on macOS (cargo-criterion issue #12).
Both issues has been fixed; since version 0.3.4
criterionwrites its output to the correct directory, andcargo-criterionalso works on macOS.