Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Update pallet-multisig benches (#12558)
Browse files Browse the repository at this point in the history
* Typo

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/bench-bot.sh" pallet dev pallet_multisig

* remove functions

* ".git/.scripts/bench-bot.sh" pallet dev pallet_multisig

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
  • Loading branch information
2 people authored and coderobe committed Oct 27, 2022
1 parent 399ab89 commit 7a4e516
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 145 deletions.
2 changes: 0 additions & 2 deletions frame/multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ pub mod pallet {
let z = call.using_encoded(|d| d.len()) as u32;
T::WeightInfo::as_multi_create(s, z)
.max(T::WeightInfo::as_multi_create_store(s, z))
.max(T::WeightInfo::as_multi_approve(s, z))
.max(T::WeightInfo::as_multi_complete(s, z))
.saturating_add(*max_weight)
Expand Down Expand Up @@ -429,7 +428,6 @@ pub mod pallet {
T::WeightInfo::approve_as_multi_create(s)
.max(T::WeightInfo::approve_as_multi_approve(s))
.max(T::WeightInfo::approve_as_multi_complete(s))
.saturating_add(*max_weight)
})]
pub fn approve_as_multi(
Expand Down
249 changes: 108 additions & 141 deletions frame/multisig/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -18,22 +18,26 @@
//! Autogenerated weights for pallet_multisig
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-05-23, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-10-26, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
// Executed Command:
// ./target/production/substrate
// /home/benchbot/cargo_target_dir/production/substrate
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=pallet_multisig
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --template=./.maintain/frame-weight-template.hbs
// --heap-pages=4096
// --json-file=/var/lib/gitlab-runner/builds/zyw4fam_/0/parity/mirrors/substrate/.git/.artifacts/bench.json
// --pallet=pallet_multisig
// --chain=dev
// --header=./HEADER-APACHE2
// --output=./frame/multisig/src/weights.rs
// --template=./.maintain/frame-weight-template.hbs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -46,213 +50,176 @@ use sp_std::marker::PhantomData;
pub trait WeightInfo {
fn as_multi_threshold_1(z: u32, ) -> Weight;
fn as_multi_create(s: u32, z: u32, ) -> Weight;
fn as_multi_create_store(s: u32, z: u32, ) -> Weight;
fn as_multi_approve(s: u32, z: u32, ) -> Weight;
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight;
fn as_multi_complete(s: u32, z: u32, ) -> Weight;
fn approve_as_multi_create(s: u32, ) -> Weight;
fn approve_as_multi_approve(s: u32, ) -> Weight;
fn approve_as_multi_complete(s: u32, ) -> Weight;
fn cancel_as_multi(s: u32, ) -> Weight;
}

/// Weights for pallet_multisig using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn as_multi_threshold_1(_z: u32, ) -> Weight {
Weight::from_ref_time(17_537_000 as u64)
/// The range of component `z` is `[0, 10000]`.
fn as_multi_threshold_1(z: u32, ) -> Weight {
// Minimum execution time: 20_283 nanoseconds.
Weight::from_ref_time(20_861_089 as u64)
// Standard Error: 5
.saturating_add(Weight::from_ref_time(583 as u64).saturating_mul(z as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_create(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(36_535_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(99_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64))
// Minimum execution time: 52_699 nanoseconds.
Weight::from_ref_time(40_874_603 as u64)
// Standard Error: 546
.saturating_add(Weight::from_ref_time(131_727 as u64).saturating_mul(s as u64))
// Standard Error: 5
.saturating_add(Weight::from_ref_time(1_537 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(39_918_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(95_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
/// The range of component `s` is `[3, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(25_524_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(94_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64))
// Minimum execution time: 39_843 nanoseconds.
Weight::from_ref_time(28_912_325 as u64)
// Standard Error: 734
.saturating_add(Weight::from_ref_time(125_761 as u64).saturating_mul(s as u64))
// Standard Error: 7
.saturating_add(Weight::from_ref_time(1_542 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(39_923_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(45_877_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(146_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
// Minimum execution time: 54_980 nanoseconds.
Weight::from_ref_time(42_087_213 as u64)
// Standard Error: 786
.saturating_add(Weight::from_ref_time(153_935 as u64).saturating_mul(s as u64))
// Standard Error: 7
.saturating_add(Weight::from_ref_time(1_545 as u64).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_create(s: u32, ) -> Weight {
Weight::from_ref_time(34_309_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(s as u64))
// Minimum execution time: 37_802 nanoseconds.
Weight::from_ref_time(39_933_623 as u64)
// Standard Error: 1_059
.saturating_add(Weight::from_ref_time(121_891 as u64).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_approve(s: u32, ) -> Weight {
Weight::from_ref_time(22_848_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(s as u64))
// Minimum execution time: 25_738 nanoseconds.
Weight::from_ref_time(27_676_766 as u64)
// Standard Error: 710
.saturating_add(Weight::from_ref_time(125_733 as u64).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn approve_as_multi_complete(s: u32, ) -> Weight {
Weight::from_ref_time(63_239_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(3 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
/// The range of component `s` is `[2, 100]`.
fn cancel_as_multi(s: u32, ) -> Weight {
Weight::from_ref_time(51_254_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
// Minimum execution time: 36_591 nanoseconds.
Weight::from_ref_time(38_707_543 as u64)
// Standard Error: 881
.saturating_add(Weight::from_ref_time(126_198 as u64).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn as_multi_threshold_1(_z: u32, ) -> Weight {
Weight::from_ref_time(17_537_000 as u64)
/// The range of component `z` is `[0, 10000]`.
fn as_multi_threshold_1(z: u32, ) -> Weight {
// Minimum execution time: 20_283 nanoseconds.
Weight::from_ref_time(20_861_089 as u64)
// Standard Error: 5
.saturating_add(Weight::from_ref_time(583 as u64).saturating_mul(z as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_create(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(36_535_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(99_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64))
// Minimum execution time: 52_699 nanoseconds.
Weight::from_ref_time(40_874_603 as u64)
// Standard Error: 546
.saturating_add(Weight::from_ref_time(131_727 as u64).saturating_mul(s as u64))
// Standard Error: 5
.saturating_add(Weight::from_ref_time(1_537 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(39_918_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(95_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
/// The range of component `s` is `[3, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(25_524_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(94_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(z as u64))
// Minimum execution time: 39_843 nanoseconds.
Weight::from_ref_time(28_912_325 as u64)
// Standard Error: 734
.saturating_add(Weight::from_ref_time(125_761 as u64).saturating_mul(s as u64))
// Standard Error: 7
.saturating_add(Weight::from_ref_time(1_542 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(39_923_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
/// The range of component `s` is `[2, 100]`.
/// The range of component `z` is `[0, 10000]`.
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
Weight::from_ref_time(45_877_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(146_000 as u64).saturating_mul(s as u64))
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
// Minimum execution time: 54_980 nanoseconds.
Weight::from_ref_time(42_087_213 as u64)
// Standard Error: 786
.saturating_add(Weight::from_ref_time(153_935 as u64).saturating_mul(s as u64))
// Standard Error: 7
.saturating_add(Weight::from_ref_time(1_545 as u64).saturating_mul(z as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_create(s: u32, ) -> Weight {
Weight::from_ref_time(34_309_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(s as u64))
// Minimum execution time: 37_802 nanoseconds.
Weight::from_ref_time(39_933_623 as u64)
// Standard Error: 1_059
.saturating_add(Weight::from_ref_time(121_891 as u64).saturating_mul(s as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:0)
/// The range of component `s` is `[2, 100]`.
fn approve_as_multi_approve(s: u32, ) -> Weight {
Weight::from_ref_time(22_848_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(114_000 as u64).saturating_mul(s as u64))
// Minimum execution time: 25_738 nanoseconds.
Weight::from_ref_time(27_676_766 as u64)
// Standard Error: 710
.saturating_add(Weight::from_ref_time(125_733 as u64).saturating_mul(s as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn approve_as_multi_complete(s: u32, ) -> Weight {
Weight::from_ref_time(63_239_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(s as u64))
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(3 as u64))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
/// The range of component `s` is `[2, 100]`.
fn cancel_as_multi(s: u32, ) -> Weight {
Weight::from_ref_time(51_254_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
// Minimum execution time: 36_591 nanoseconds.
Weight::from_ref_time(38_707_543 as u64)
// Standard Error: 881
.saturating_add(Weight::from_ref_time(126_198 as u64).saturating_mul(s as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
}
2 changes: 1 addition & 1 deletion frame/transaction-payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ where
Self(fee)
}

/// Returns the tip as being choosen by the transaction sender.
/// Returns the tip as being chosen by the transaction sender.
pub fn tip(&self) -> BalanceOf<T> {
self.0
}
Expand Down
2 changes: 1 addition & 1 deletion frame/utility/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub mod pallet {
// Align the call size to 1KB. As we are currently compiling the runtime for native/wasm
// the `size_of` of the `Call` can be different. To ensure that this don't leads to
// mismatches between native/wasm or to different metadata for the same runtime, we
// algin the call size. The value is choosen big enough to hopefully never reach it.
// algin the call size. The value is chosen big enough to hopefully never reach it.
const CALL_ALIGN: u32 = 1024;

#[pallet::extra_constants]
Expand Down

0 comments on commit 7a4e516

Please sign in to comment.