Loading tutorials
std::time::Instant is not enough, and it describes what Criterion.rs adds. Later chapters cover project setup, writing benchmarks, and reading results. Here you build the reasoning that makes those ste6 min readcargo bench runs a Criterion benchmark. It covers the dependency, the bench target, the directory layout, and the errors that usually appear on the first try.5 min readcargo build and cargo test, and edit Cargo.toml. Reading the timing report and the statistics behind i6 min readbench_function and Bencher::iter, and that you know cargo bench builds with optimizations. You do not need to read assembly. Where assembly matters, the chapter says how to look at it.6 min readcargo bench on a Criterion target, as set up in the earlier chapters. It also assumes you know what Bencher::iter does and have a rough idea of mean, median, and standard deviation. Here you will learn what happens between c.bench_function(...) and the `time: [7 min readcargo bench on a Criterion benchmark with harness = false, as set up in the earlier chapters. It also assumes you know what a confidence interval is in rough terms: a range that probably contains the true value. Here you learn to read each line Criterion 6 min readbench_function benchmark, that your Cargo.toml already has a [[bench]] target with harness = false, and that you know why black_box is needed. Here you will measure the same code across several inputs, and compare several implementations side by s6 min readharness = false), and that you can write a benchmark with bench_function and Bencher::iter. It also assumes you know black_box. You should be comfortable with closures that take ownership of values (FnMut() -> T, move semant6 min readbench_function and Bencher::iter. It also assumes you have used benchmark groups with BenchmarkId, as in the previous chapters. Here you will tell Criterion how much work each iteration does. Criterion then reports a r6 min readbench_function and Bencher::iter, and that you know how to read the console output. You should know that Criterion collects many samples, and that criterion_group! registers benchmark functions. Here you will learn which set6 min readharness = false), that you can read the time: [low mid high] line in the console output, and that you know what the change: line means. You also need basic Git, because the workflow compares two versions of the code.6 min readbench_function, iter, and black_box, and that you have read a console report with its time interval and change line. It covers two kinds of problems. The first is measuring the wrong thing, where the number is stable but mea6 min readbench_function and iter, and that you know how --save-baseline and --baseline work. It also assumes you have used 7 min read