Skip to main content

Baseline

Struct Baseline 

Source
pub struct Baseline {
    rows: BTreeMap<RowKey, Vec<u64>>,
}
Expand description

A previous run of this harness, read back as the samples it recorded.

Fields§

§rows: BTreeMap<RowKey, Vec<u64>>

Implementations§

Source§

impl Baseline

Source

pub fn parse(text: &str) -> Result<Baseline, String>

Reads a baseline from this harness’s own JSONL output.

This parses the format this file writes and nothing else. It is not a JSON parser and does not pretend to be one: it looks for the three string fields that name a row and for the sample array inside wall_ns, and it skips any line that does not carry all four. Lines that legitimately do not — an unsupported refusal, a trace_overhead ratio, a comparison from an earlier run — are therefore skipped rather than treated as errors.

A baseline written by an older build, before samples was reported, parses as empty. That is the wanted behaviour: comparing against summaries would mean inventing the spread that made them.

Source

pub fn len(&self) -> usize

How many rows the baseline carries.

Source

pub fn samples( &self, benchmark: &str, kind: &str, backend: &str, ) -> Option<&[u64]>

The samples recorded for one row, if the baseline has it.

A row the baseline does not have is not an error: benchmarks are added and the VM learns to run ones it previously refused, and a baseline taken before either is still a baseline for every row it does have.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.