euv-performance 0.47.1

Reproducible CPU, layout, rasterization, and allocation benchmarks for the cross-platform euv runtime.
Documentation
use super::*;

/// Timing, throughput, and steady-state allocation telemetry for a single micro- or macro-benchmark.
#[derive(Clone, Debug, Deserialize, Getter, New, PartialEq, Serialize)]
pub struct BenchMetric {
    /// Canonical benchmark name.
    pub(crate) name: String,
    /// Number of measured iterations.
    #[get(type(copy))]
    pub(crate) iterations: usize,
    /// Total elapsed wall time in microseconds.
    #[get(type(copy))]
    pub(crate) total_micros: u64,
    /// Average nanoseconds per iteration.
    #[get(type(copy))]
    pub(crate) ns_per_op: f64,
    /// Throughput in operations per second.
    #[get(type(copy))]
    pub(crate) ops_per_sec: f64,
    /// Additional benchmark-specific verification metadata.
    pub(crate) detail: String,
    /// Total heap allocation count recorded across all measured iterations.
    #[get(type(copy))]
    #[new(skip)]
    #[serde(default)]
    pub(crate) alloc_count: u64,
    /// Total heap bytes allocated across all measured iterations.
    #[get(type(copy))]
    #[new(skip)]
    #[serde(default)]
    pub(crate) bytes_allocated: u64,
    /// Mean heap allocations per measured iteration.
    #[get(type(copy))]
    #[new(skip)]
    #[serde(default)]
    pub(crate) allocs_per_op: f64,
    /// Mean heap bytes allocated per measured iteration.
    #[get(type(copy))]
    #[new(skip)]
    #[serde(default)]
    pub(crate) bytes_per_op: f64,
}

/// Complete serialized report produced by `run_full_benchmark_suite`.
#[derive(Clone, Debug, Deserialize, Getter, New, PartialEq, Serialize)]
pub struct BenchReport {
    /// Ordered benchmark results.
    pub(crate) metrics: Vec<BenchMetric>,
}

/// Named benchmark descriptor pairing a canonical metric ID with its runner function.
#[derive(Clone, Copy, Debug)]
pub(crate) struct BenchCase {
    /// Canonical benchmark metric name.
    pub(crate) name: &'static str,
    /// Function executing the benchmark and returning its `BenchMetric`.
    pub(crate) runner: fn() -> BenchMetric,
}