Loading tutorials
Cargo.toml, and know what a dev-dependency is. By the end you will have a project with a Criterion benchmark target that compiles and runs.2 min readCargo.toml. It also assumes you have already added Criterion as a dev-dependency. You will write a benchmark for a small function and run it.3 min readbench_function and Bencher::iter, and that you have a [[bench]] target with harness = false. Here you learn why the optimizer can make a benchmark meaningless, and how black_box prevents that.3 min readcargo bench and the numbers Criterion prints. It assumes you can write a basic Criterion benchmark with bench_function and Bencher::iter, and that you know why harness = false is set in Cargo.toml. Knowing the measurement model helps you pick sens4 min readcargo bench on a Criterion target with harness = false and that you have written a benchmark with bench_function. Here you will learn to read what Criterion prints and what it writes to disk.3 min readbench_function and black_box, and that your project has a [[bench]] target with harness = false. Here you will measure one function across several input sizes and read the results side by side.3 min readbench_function and Bencher::iter, and that your project already has the harness = false bench target from earlier chapters.3 min readblack_box, and use benchmark groups with BenchmarkId. You should be able to read the time: line in Criterion's console output.2 min readbench_function and iter, and that you know what a benchmark group is. It covers the two settings you will change most often: how many samples Criterion collects and how long it spends collecting them.2 min readcargo bench on a Criterion benchmark and read its console output. You should know what bench_function and black_box do. If not, review the earlier chapters on writing a first benchmark and reading the output.3 min readbench_function, use black_box, and read the console output. It covers the mistakes that produce wrong numbers and the system effects that make good numbers wobble.3 min readharness = false, and that you know how to save and compare baselines with --save-baseline and --baseline. It also assumes basic familiarity with a CI service such as GitHub Actions.3 min read