INNER CODE UNIT · Rust

from_le_bytes

TheMaxMur/RS-Key · crates/rsk-bench/src/lib.rs:63

    pub fn from_le_bytes(b: &[u8; SUMMARY_LEN]) -> Self {
        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 {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…