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>
§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,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl Encode for PageCosts
impl Encode for PageCosts
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 )
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
impl EncodeLike<PageCosts> for PageCosts
Auto Trait Implementations§
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> 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
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self and consume all of the given input data. Read more