Struct core_processor::configs::PageCosts
source · 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
impl PageCosts
sourcepub fn lazy_pages_weights(&self) -> LazyPagesWeights
pub fn lazy_pages_weights(&self) -> LazyPagesWeights
Calculates and returns weights for lazy-pages.
sourcepub fn new_for_tests() -> Self
pub fn new_for_tests() -> Self
New one for tests usage.
Trait Implementations§
source§impl Decode for PageCosts
impl Decode for PageCosts
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl Encode for PageCosts
impl Encode for PageCosts
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
impl EncodeLike for PageCosts
Auto Trait Implementations§
impl Freeze for PageCosts
impl RefUnwindSafe for PageCosts
impl Send for PageCosts
impl Sync for PageCosts
impl Unpin for PageCosts
impl UnwindSafe for PageCosts
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.