INNER CODE UNIT · Rust
u
TheMaxMur/RS-Key · crates/rsk-bench/src/lib.rs:64
let u = |i: usize| u32::from_le_bytes([b[i], b[i + 1], b[i + 2], b[i + 3]]);
Summary {
n: u(0),
cold: u(4),
min: u(8),
median: u(12),
mad: u(16),
}
}
}
/// Summarize per-iteration `samples`. `cold` is `samples[0]`; the warm statistics
/// are over `samples[warmup..]` (pass `warmup = 1` to exclude the cold sample from
/// the steady-state median). Reorders `samples` in place (the caller no longer
/// needs their order once summarized). An empty warm range collapses every warm
/// field onto `cold` with `n = 0`.
pub fn summarize(samples: &mut [u32], warmup: usize) -> Summary {
let cold = samples.first().copied().unwrap_or(0);