liveBook · Manning

Criterion.rs

As explained in Latency

Criterion is a Rust benchmarking library for statistically evaluating the performance of code.

Criterion.rs is a Rust benchmarking library that repeatedly measures code to build statistical confidence in runtime results. It supports reliable microbenchmarks and can connect measurements to flame graphs for locating expensive call paths. section 7.7

Fibonacci implementation comparison

Benchmarking recursive, memoized, and iterative Fibonacci implementations measures approximately 157.7 ns, 44.2 ns, and 5.07 ns respectively, while reporting measurement outliers.

How Latency covers it

How deep it goes
Provides setup, execution, statistical output, implementation comparison, and profiling, but does not detail Criterion internals.
Examples
Uses recursive, memoized, and iterative Fibonacci implementations, cargo bench output, outlier reports, and a flame graph.
What it assumes
Assumes basic Rust and algorithm familiarity while demonstrating the benchmark setup and measurement workflow directly.
What you can do after
Diagnose performance with statistically informed timings, compare implementations, and locate costly call paths using flame graphs.
How it connects
Connects benchmarking with microbenchmarks, runtime analysis, algorithmic complexity, CPU profiling, flame graphs, and optimization.

Also explained in

Compare how 3 books explain Criterion.rs →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Latency. The section links point to the parts of the book it draws on.