Add benchmarks for pallet-membership (#8596)

* Add benchmakrs for membership

* Update frame/membership/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Make it all work

* Add mock weights

* Update frame/membership/src/lib.rs

* Update frame/membership/src/lib.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/membership/src/weights.rs --template=./.maintain/frame-weight-template.hbs

* cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/membership/src/weights.rs --template=./.maintain/frame-weight-template.hbs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
Kian Paimani
2021-04-18 06:52:05 +02:00
committed by GitHub
parent 92630df143
commit b6b107030d
9 changed files with 392 additions and 25 deletions
-5
View File
@@ -44,7 +44,6 @@ use sp_std::marker::PhantomData;
/// Weight functions needed for pallet_im_online.
pub trait WeightInfo {
fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight;
}
/// Weights for pallet_im_online using the Substrate node and recommended hardware.
@@ -56,9 +55,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
.saturating_add((481_000 as Weight).saturating_mul(e as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
// For backwards compatibility and tests
@@ -69,7 +66,5 @@ impl WeightInfo for () {
.saturating_add((481_000 as Weight).saturating_mul(e as Weight))
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
}