Skip to main content

Pressure

Struct Pressure 

Source
pub struct Pressure { /* private fields */ }
Expand description

What every function a run allocated cost, in the order they were allocated.

Kept per function rather than as one total, because the number that matters is a hot loop and the way to find one in a file the size of an amalgamation is to sort the rows. The total is there too, since it is what a comparison of two builds is usually about and nobody should have to add up ten thousand lines to get it.

Implementations§

Source§

impl Pressure

Source

pub fn new() -> Self

Nothing recorded yet.

Source

pub fn record(&mut self, name: &str, cost: Cost)

Writes down what one function cost.

Source

pub fn merge(&mut self, other: &Self)

Takes in everything another one recorded, which is how one file’s answer joins a run’s.

Source

pub fn functions(&self) -> usize

How many functions were allocated.

Source

pub fn total(&self) -> Cost

Every function’s cost added together.

Source

pub fn listing(&self) -> String

What -Zregister-pressure=FILE writes.

A comment holding the totals and then one line per function, each of them the three counts and then the name. The counts come first because they are the fields a reader is sorting on and the name is the one field that could be any length, which is the layout -Zrule-coverage uses for the same reason.

Every function is listed, including the ones that spilled nothing, so that one of these files says how much of the module was measured as well as what the answer was. A build that stopped early and a build that spilled nowhere would otherwise look the same.

Trait Implementations§

Source§

impl Clone for Pressure

Source§

fn clone(&self) -> Pressure

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Pressure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Pressure

Source§

fn default() -> Pressure

Returns the “default value” for a type. Read more
Source§

impl Eq for Pressure

Source§

impl PartialEq for Pressure

Source§

fn eq(&self, other: &Pressure) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Pressure

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.