Skip to content
Snippets Groups Projects
Commit 14030b41 authored by bgallois's avatar bgallois Committed by Hugo Trentesaux
Browse files

feat(runtimes): use our benchmarks for pallet membership

parent e3864552
No related branches found
No related tags found
1 merge request!147Membership pallet benchmark
...@@ -454,6 +454,7 @@ macro_rules! pallets_config { ...@@ -454,6 +454,7 @@ macro_rules! pallets_config {
type OnEvent = OnMembershipEventHandler<Wot, Runtime>; type OnEvent = OnMembershipEventHandler<Wot, Runtime>;
type PendingMembershipPeriod = PendingMembershipPeriod; type PendingMembershipPeriod = PendingMembershipPeriod;
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
type WeightInfo = common_runtime::weights::pallet_membership_membership::WeightInfo<Runtime>;
} }
impl pallet_certification::Config<Instance1> for Runtime { impl pallet_certification::Config<Instance1> for Runtime {
...@@ -490,6 +491,7 @@ macro_rules! pallets_config { ...@@ -490,6 +491,7 @@ macro_rules! pallets_config {
type OnEvent = OnSmithMembershipEventHandler<SmithSubWot, Runtime>; type OnEvent = OnSmithMembershipEventHandler<SmithSubWot, Runtime>;
type PendingMembershipPeriod = SmithPendingMembershipPeriod; type PendingMembershipPeriod = SmithPendingMembershipPeriod;
type RuntimeEvent = RuntimeEvent; type RuntimeEvent = RuntimeEvent;
type WeightInfo = common_runtime::weights::pallet_membership_smith_membership::WeightInfo<Runtime>;
} }
impl pallet_certification::Config<Instance2> for Runtime { impl pallet_certification::Config<Instance2> for Runtime {
......
...@@ -36,4 +36,6 @@ pub mod pallet_duniter_account; ...@@ -36,4 +36,6 @@ pub mod pallet_duniter_account;
pub mod pallet_oneshot_account; pub mod pallet_oneshot_account;
pub mod pallet_certification_cert; pub mod pallet_certification_cert;
pub mod pallet_certification_smith_cert; pub mod pallet_certification_smith_cert;
pub mod pallet_membership_membership;
pub mod pallet_membership_smith_membership;
pub mod paritydb_weights; pub mod paritydb_weights;
// Copyright 2021-2022 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_membership`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-04-26, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `benjamin-xps139380`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
// target/release/duniter
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_membership
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/common/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_membership`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> {
// Storage: Membership PendingMembership (r:1 w:1)
// Storage: Membership Membership (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: Membership PendingMembershipsExpireOn (r:1 w:1)
fn force_request_membership() -> Weight {
// Minimum execution time: 89_725 nanoseconds.
Weight::from_ref_time(98_333_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Identity Identities (r:1 w:0)
fn request_membership() -> Weight {
// Minimum execution time: 48_477 nanoseconds.
Weight::from_ref_time(50_689_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Membership Membership (r:1 w:1)
// Storage: Cert StorageIdtyCertMeta (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: Membership PendingMembership (r:1 w:1)
// Storage: Membership CounterForMembership (r:1 w:1)
// Storage: Membership MembershipsExpireOn (r:1 w:1)
fn claim_membership() -> Weight {
// Minimum execution time: 144_079 nanoseconds.
Weight::from_ref_time(146_565_000 as u64)
.saturating_add(T::DbWeight::get().reads(7 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Membership Membership (r:1 w:1)
// Storage: Identity Identities (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: Membership MembershipsExpireOn (r:1 w:1)
fn renew_membership() -> Weight {
// Minimum execution time: 120_859 nanoseconds.
Weight::from_ref_time(124_222_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Membership Membership (r:1 w:1)
// Storage: Membership CounterForMembership (r:1 w:1)
// Storage: Identity Identities (r:1 w:0)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:0)
fn revoke_membership() -> Weight {
// Minimum execution time: 109_486 nanoseconds.
Weight::from_ref_time(113_303_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
}
// Copyright 2021-2022 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
//! Autogenerated weights for `pallet_membership`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-04-26, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `benjamin-xps139380`, CPU: `Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
// target/release/duniter
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_membership
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/common/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_membership`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> {
// Storage: SmithsMembership PendingMembership (r:1 w:1)
// Storage: SmithsMembership Membership (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: SmithsMembership PendingMembershipsExpireOn (r:1 w:1)
fn force_request_membership() -> Weight {
// Minimum execution time: 96_077 nanoseconds.
Weight::from_ref_time(98_570_000 as u64)
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Identity Identities (r:1 w:0)
// Storage: SmithsMembership PendingMembership (r:1 w:1)
// Storage: SmithsMembership Membership (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: SmithsMembership PendingMembershipsExpireOn (r:1 w:1)
fn request_membership() -> Weight {
// Minimum execution time: 122_839 nanoseconds.
Weight::from_ref_time(125_861_000 as u64)
.saturating_add(T::DbWeight::get().reads(6 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:2 w:0)
// Storage: SmithsMembership Membership (r:2 w:1)
// Storage: SmithsCert StorageIdtyCertMeta (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: SmithsMembership PendingMembership (r:1 w:1)
// Storage: SmithsMembership CounterForMembership (r:1 w:1)
// Storage: SmithsMembership MembershipsExpireOn (r:1 w:1)
fn claim_membership() -> Weight {
// Minimum execution time: 165_369 nanoseconds.
Weight::from_ref_time(167_607_000 as u64)
.saturating_add(T::DbWeight::get().reads(9 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: SmithsMembership Membership (r:1 w:1)
// Storage: Identity Identities (r:1 w:0)
// Storage: Parameters ParametersStorage (r:1 w:0)
// Storage: SmithsMembership MembershipsExpireOn (r:1 w:1)
fn renew_membership() -> Weight {
// Minimum execution time: 121_761 nanoseconds.
Weight::from_ref_time(125_210_000 as u64)
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: SmithsMembership Membership (r:1 w:1)
// Storage: SmithsMembership CounterForMembership (r:1 w:1)
// Storage: AuthorityMembers Members (r:1 w:1)
// Storage: AuthorityMembers OnlineAuthorities (r:1 w:1)
// Storage: AuthorityMembers AuthoritiesCounter (r:1 w:1)
// Storage: AuthorityMembers IncomingAuthorities (r:1 w:1)
// Storage: Session NextKeys (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: Session KeyOwner (r:0 w:4)
fn revoke_membership() -> Weight {
// Minimum execution time: 234_173 nanoseconds.
Weight::from_ref_time(239_334_000 as u64)
.saturating_add(T::DbWeight::get().reads(9 as u64))
.saturating_add(T::DbWeight::get().writes(12 as u64))
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment