pub struct PageCosts {
    pub lazy_pages_signal_read: CostPerPage<GearPage>,
    pub lazy_pages_signal_write: CostPerPage<GearPage>,
    pub lazy_pages_signal_write_after_read: CostPerPage<GearPage>,
    pub lazy_pages_host_func_read: CostPerPage<GearPage>,
    pub lazy_pages_host_func_write: CostPerPage<GearPage>,
    pub lazy_pages_host_func_write_after_read: CostPerPage<GearPage>,
    pub load_page_data: CostPerPage<GearPage>,
    pub upload_page_data: CostPerPage<GearPage>,
    pub static_page: CostPerPage<WasmPage>,
    pub mem_grow: CostPerPage<WasmPage>,
    pub parachain_load_heuristic: CostPerPage<GearPage>,
}
Expand description

Memory operations costs.

Each weight with lazy_pages_ prefix contains weight for storage read, because for each first page access we need at least check if page exists in storage. But they do not include cost for loading page data from storage into program memory. This weight is taken in account separately, when loading occurs.

Lazy-pages write accesses does not include cost for uploading page data to storage, because uploading happens after execution, so benchmarks do not include this cost. But they include cost for processing changed page data in runtime.

Fields§

§lazy_pages_signal_read: CostPerPage<GearPage>

Cost per one GearPage signal read processing in lazy-pages.

§lazy_pages_signal_write: CostPerPage<GearPage>

Cost per one GearPage signal write processing in lazy-pages,

§lazy_pages_signal_write_after_read: CostPerPage<GearPage>

Cost per one GearPage signal write after read processing in lazy-pages.

§lazy_pages_host_func_read: CostPerPage<GearPage>

Cost per one GearPage host func read access processing in lazy-pages.

§lazy_pages_host_func_write: CostPerPage<GearPage>

Cost per one GearPage host func write access processing in lazy-pages.

§lazy_pages_host_func_write_after_read: CostPerPage<GearPage>

Cost per one GearPage host func write after read access processing in lazy-pages,

§load_page_data: CostPerPage<GearPage>

Cost per one GearPage data loading from storage and moving it in program memory. Does not include cost for storage read, because it is taken in account separately.

§upload_page_data: CostPerPage<GearPage>

Cost per one GearPage uploading data to storage. Does not include cost for processing changed page data in runtime, cause it is taken in account separately.

§static_page: CostPerPage<WasmPage>

Cost per one WasmPage static page. Static pages can have static data, and executor must to move this data to static pages before execution.

§mem_grow: CostPerPage<WasmPage>

Cost per one WasmPage for memory growing.

§parachain_load_heuristic: CostPerPage<GearPage>

Cost per one GearPage storage read, when para-chain execution.

Implementations§

source§

impl PageCosts

source

pub fn lazy_pages_weights(&self) -> LazyPagesWeights

Calculates and returns weights for lazy-pages.

source

pub fn new_for_tests() -> Self

New one for tests usage.

Trait Implementations§

source§

impl Clone for PageCosts

source§

fn clone(&self) -> PageCosts

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for PageCosts

source§

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

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

impl Decode for PageCosts

source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>

Attempt to deserialise the value from input.
§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§

fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
source§

impl Default for PageCosts

source§

fn default() -> PageCosts

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

impl Encode for PageCosts

source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )

Convert self to a slice and append it to the destination.
§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

fn encode(&self) -> Vec<u8, Global>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl EncodeLike<PageCosts> for PageCosts

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> DecodeAll for Twhere T: Decode,

§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
§

impl<T> DecodeLimit for Twhere T: Decode,

§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8] ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. 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 Twhere 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.

§

impl<T> KeyedVec for Twhere T: Codec,

§

fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8, Global>

Return an encoding of Self prepended by given slice.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<S> Codec for Swhere S: Decode + Encode,

§

impl<T> EncodeLike<&&T> for Twhere T: Encode,

§

impl<T> EncodeLike<&T> for Twhere T: Encode,

§

impl<T> EncodeLike<&mut T> for Twhere T: Encode,

§

impl<T> EncodeLike<Arc<T>> for Twhere T: Encode,

§

impl<T> EncodeLike<Box<T, Global>> for Twhere T: Encode,

§

impl<'a, T> EncodeLike<Cow<'a, T>> for Twhere T: ToOwned + Encode,

§

impl<T> EncodeLike<Rc<T>> for Twhere T: Encode,

§

impl<S> FullCodec for Swhere S: Decode + FullEncode,

§

impl<S> FullEncode for Swhere S: Encode + EncodeLike<S>,

source§

impl<T> JsonSchemaMaybe for T