Skip to content
Snippets Groups Projects
Commit 8f20d4e9 authored by Éloïs's avatar Éloïs
Browse files

bench real weights for pallet ud

parent 6d84fcc9
No related branches found
No related tags found
1 merge request!83feat(runtime): create UDs manually with new call universalDividend.claim_uds
......@@ -374,8 +374,7 @@ pub mod pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Claim Universal Dividends
//#[pallet::weight(T::WeightInfo::claim_uds(T::MaxPastReeval::get()))]
#[pallet::weight(0)] // TODO benchmark weights
#[pallet::weight(T::WeightInfo::claim_uds(T::MaxPastReeval::get()))]
pub fn claim_uds(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
Self::do_claim_uds(&who)
......
......@@ -23,6 +23,7 @@ pub trait WeightInfo {
fn on_initialize() -> Weight;
fn on_initialize_ud_created() -> Weight;
fn on_initialize_ud_reevalued() -> Weight;
fn claim_uds(n: u32) -> Weight;
fn transfer_ud() -> Weight;
fn transfer_ud_keep_alive() -> Weight;
}
......@@ -54,6 +55,17 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().reads(6 as Weight))
.saturating_add(RocksDbWeight::get().writes(5 as Weight))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Identity Identities (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:0)
// Storage: UniversalDividend PastReevals (r:1 w:0)
fn claim_uds(n: u32) -> Weight {
(32_514_000 as Weight)
// Standard Error: 32_000
.saturating_add((8_000 as Weight).saturating_mul(n as Weight))
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
// Storage: UniversalDividend CurrentUd (r:1 w:0)
// Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1)
......
......@@ -17,7 +17,7 @@
//! Autogenerated weights for `pallet_universal_dividend`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-06-12, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-07-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
......@@ -46,7 +46,7 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightInfo<T> {
fn on_initialize() -> Weight {
104_055_000 as Weight
111_220_000 as Weight
}
// Storage: Membership CounterForMembership (r:1 w:0)
// Storage: UniversalDividend NextReeval (r:1 w:0)
......@@ -54,7 +54,7 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn
// Storage: UniversalDividend MonetaryMass (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:1)
fn on_initialize_ud_created() -> Weight {
(1_000_000_000 as Weight)
(525_382_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
......@@ -65,10 +65,21 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn
// Storage: UniversalDividend PastReevals (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:1)
fn on_initialize_ud_reevalued() -> Weight {
(1_500_000_000 as Weight)
(1_161_595_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Identity Identities (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:0)
// Storage: UniversalDividend PastReevals (r:1 w:0)
fn claim_uds(n: u32) -> Weight {
(1_221_776_000 as Weight)
// Standard Error: 958_000
.saturating_add((7_709_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: UniversalDividend CurrentUd (r:1 w:0)
// Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment