Skip to main content

instructions

Function instructions 

Source
pub fn instructions(
    cmd: &[String],
    dir: Option<&Path>,
    settings: &Settings,
) -> Result<Option<Counted>>
Expand description

Instruction count via valgrind --tool=cachegrind, repeated.

Reports the minimum, for the same reason wall clock does: the extra work a subject sometimes performs is one-sided. A run that consults the network or populates a cache can only retire more instructions than the quiet path, never fewer, so the floor is the stable estimator.

Returns Ok(None) when valgrind is unavailable rather than failing: this is the expected state on macOS (no usable Apple Silicon support) and Windows. Those platforms record timing only, and the CI gate lives on the Linux job. Locally, a container gets you counters on any host.