Update benchmarking macros (#3934)

Current benchmarking macro returns a closure with the captured
benchmarked code.
This can cause issues when the benchmarked code has complex lifetime
requirements.

This PR updates the existing macro by injecting the recording parameter
and invoking the start / stop method around the benchmarked block
instead of returning a closure

One other added benefit is that you can write this kind of code now as
well:

```rust
let v;
#[block]
{ v = func.call(); }
dbg!(v); // or assert something on v
```


[Weights compare
link](https://weights.tasty.limo/compare?unit=weight&ignore_errors=true&threshold=10&method=asymptotic&repo=polkadot-sdk&old=pg/fix-weights&new=pg/bench_update&path_pattern=substrate/frame/**/src/weights.rs,polkadot/runtime/*/src/weights/**/*.rs,polkadot/bridges/modules/*/src/weights.rs,cumulus/**/weights/*.rs,cumulus/**/weights/xcm/*.rs,cumulus/**/src/weights.rs)

---------

Co-authored-by: command-bot <>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This commit is contained in:
PG Herveou
2024-04-10 08:44:46 +02:00
committed by GitHub
parent ddb53c87f5
commit d38f6e6728
65 changed files with 11402 additions and 10551 deletions
+212 -193
View File
@@ -15,16 +15,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Autogenerated weights for pallet_conviction_voting
//! Autogenerated weights for `pallet_conviction_voting`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-06-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-04-08, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-e8ezs4ez-project-145-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
// Executed Command:
// ./target/production/substrate
// ./target/production/substrate-node
// benchmark
// pallet
// --chain=dev
@@ -35,12 +35,11 @@
// --no-median-slopes
// --no-min-squares
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./frame/conviction-voting/src/weights.rs
// --header=./HEADER-APACHE2
// --template=./.maintain/frame-weight-template.hbs
// --output=./substrate/frame/conviction-voting/src/weights.rs
// --header=./substrate/HEADER-APACHE2
// --template=./substrate/.maintain/frame-weight-template.hbs
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
@@ -50,7 +49,7 @@
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;
/// Weight functions needed for pallet_conviction_voting.
/// Weight functions needed for `pallet_conviction_voting`.
pub trait WeightInfo {
fn vote_new() -> Weight;
fn vote_existing() -> Weight;
@@ -61,280 +60,300 @@ pub trait WeightInfo {
fn unlock() -> Weight;
}
/// Weights for pallet_conviction_voting using the Substrate node and recommended hardware.
/// Weights for `pallet_conviction_voting` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13074`
// Measured: `13141`
// Estimated: `219984`
// Minimum execution time: 112_936_000 picoseconds.
Weight::from_parts(116_972_000, 219984)
// Minimum execution time: 114_422_000 picoseconds.
Weight::from_parts(118_642_000, 219984)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
.saturating_add(T::DbWeight::get().writes(7_u64))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `20216`
// Measured: `20283`
// Estimated: `219984`
// Minimum execution time: 291_971_000 picoseconds.
Weight::from_parts(301_738_000, 219984)
// Minimum execution time: 290_934_000 picoseconds.
Weight::from_parts(303_286_000, 219984)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
.saturating_add(T::DbWeight::get().writes(7_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `19968`
// Measured: `20035`
// Estimated: `219984`
// Minimum execution time: 262_582_000 picoseconds.
Weight::from_parts(270_955_000, 219984)
// Minimum execution time: 277_464_000 picoseconds.
Weight::from_parts(284_288_000, 219984)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `12675`
// Measured: `12742`
// Estimated: `30706`
// Minimum execution time: 52_909_000 picoseconds.
Weight::from_parts(56_365_000, 30706)
// Minimum execution time: 54_538_000 picoseconds.
Weight::from_parts(55_758_000, 30706)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 1]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `240 + r * (1627 ±0)`
// Measured: `306 + r * (1628 ±0)`
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 54_640_000 picoseconds.
Weight::from_parts(57_185_281, 109992)
// Standard Error: 193_362
.saturating_add(Weight::from_parts(44_897_418, 0).saturating_mul(r.into()))
// Minimum execution time: 47_243_000 picoseconds.
Weight::from_parts(50_023_534, 109992)
// Standard Error: 228_993
.saturating_add(Weight::from_parts(43_173_465, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 1]`.
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `406 + r * (1376 ±0)`
// Measured: `472 + r * (1377 ±0)`
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 26_514_000 picoseconds.
Weight::from_parts(28_083_732, 109992)
// Standard Error: 104_905
.saturating_add(Weight::from_parts(40_722_467, 0).saturating_mul(r.into()))
// Minimum execution time: 23_529_000 picoseconds.
Weight::from_parts(25_071_526, 109992)
// Standard Error: 138_190
.saturating_add(Weight::from_parts(40_350_973, 0).saturating_mul(r.into()))
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes(2_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(T::DbWeight::get().writes((4_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `11734`
// Measured: `11800`
// Estimated: `30706`
// Minimum execution time: 71_140_000 picoseconds.
Weight::from_parts(77_388_000, 30706)
// Minimum execution time: 69_473_000 picoseconds.
Weight::from_parts(71_519_000, 30706)
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
}
// For backwards compatibility and tests
// For backwards compatibility and tests.
impl WeightInfo for () {
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn vote_new() -> Weight {
// Proof Size summary in bytes:
// Measured: `13074`
// Measured: `13141`
// Estimated: `219984`
// Minimum execution time: 112_936_000 picoseconds.
Weight::from_parts(116_972_000, 219984)
// Minimum execution time: 114_422_000 picoseconds.
Weight::from_parts(118_642_000, 219984)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
.saturating_add(RocksDbWeight::get().writes(7_u64))
}
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn vote_existing() -> Weight {
// Proof Size summary in bytes:
// Measured: `20216`
// Measured: `20283`
// Estimated: `219984`
// Minimum execution time: 291_971_000 picoseconds.
Weight::from_parts(301_738_000, 219984)
// Minimum execution time: 290_934_000 picoseconds.
Weight::from_parts(303_286_000, 219984)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
.saturating_add(RocksDbWeight::get().writes(7_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
fn remove_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `19968`
// Measured: `20035`
// Estimated: `219984`
// Minimum execution time: 262_582_000 picoseconds.
Weight::from_parts(270_955_000, 219984)
// Minimum execution time: 277_464_000 picoseconds.
Weight::from_parts(284_288_000, 219984)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:0)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:0)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
fn remove_other_vote() -> Weight {
// Proof Size summary in bytes:
// Measured: `12675`
// Measured: `12742`
// Estimated: `30706`
// Minimum execution time: 52_909_000 picoseconds.
Weight::from_parts(56_365_000, 30706)
// Minimum execution time: 54_538_000 picoseconds.
Weight::from_parts(55_758_000, 30706)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 1]`.
fn delegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `240 + r * (1627 ±0)`
// Measured: `306 + r * (1628 ±0)`
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 54_640_000 picoseconds.
Weight::from_parts(57_185_281, 109992)
// Standard Error: 193_362
.saturating_add(Weight::from_parts(44_897_418, 0).saturating_mul(r.into()))
// Minimum execution time: 47_243_000 picoseconds.
Weight::from_parts(50_023_534, 109992)
// Standard Error: 228_993
.saturating_add(Weight::from_parts(43_173_465, 0).saturating_mul(r.into()))
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:2 w:2)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: Referenda ReferendumInfoFor (r:1 w:1)
/// Proof: Referenda ReferendumInfoFor (max_values: None, max_size: Some(366), added: 2841, mode: MaxEncodedLen)
/// Storage: Scheduler Agenda (r:2 w:2)
/// Proof: Scheduler Agenda (max_values: None, max_size: Some(107022), added: 109497, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:2 w:2)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `Referenda::ReferendumInfoFor` (r:1 w:1)
/// Proof: `Referenda::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(366), added: 2841, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:2 w:2)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Retries` (r:0 w:1)
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
/// The range of component `r` is `[0, 1]`.
fn undelegate(r: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `406 + r * (1376 ±0)`
// Measured: `472 + r * (1377 ±0)`
// Estimated: `109992 + r * (109992 ±0)`
// Minimum execution time: 26_514_000 picoseconds.
Weight::from_parts(28_083_732, 109992)
// Standard Error: 104_905
.saturating_add(Weight::from_parts(40_722_467, 0).saturating_mul(r.into()))
// Minimum execution time: 23_529_000 picoseconds.
Weight::from_parts(25_071_526, 109992)
// Standard Error: 138_190
.saturating_add(Weight::from_parts(40_350_973, 0).saturating_mul(r.into()))
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes(2_u64))
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into())))
.saturating_add(RocksDbWeight::get().writes((4_u64).saturating_mul(r.into())))
.saturating_add(Weight::from_parts(0, 109992).saturating_mul(r.into()))
}
/// Storage: ConvictionVoting VotingFor (r:1 w:1)
/// Proof: ConvictionVoting VotingFor (max_values: None, max_size: Some(27241), added: 29716, mode: MaxEncodedLen)
/// Storage: ConvictionVoting ClassLocksFor (r:1 w:1)
/// Proof: ConvictionVoting ClassLocksFor (max_values: None, max_size: Some(59), added: 2534, mode: MaxEncodedLen)
/// Storage: Balances Locks (r:1 w:1)
/// Proof: Balances Locks (max_values: None, max_size: Some(1299), added: 3774, mode: MaxEncodedLen)
/// Storage: Balances Freezes (r:1 w:0)
/// Proof: Balances Freezes (max_values: None, max_size: Some(49), added: 2524, mode: MaxEncodedLen)
/// Storage: `ConvictionVoting::VotingFor` (r:1 w:1)
/// Proof: `ConvictionVoting::VotingFor` (`max_values`: None, `max_size`: Some(27241), added: 29716, mode: `MaxEncodedLen`)
/// Storage: `ConvictionVoting::ClassLocksFor` (r:1 w:1)
/// Proof: `ConvictionVoting::ClassLocksFor` (`max_values`: None, `max_size`: Some(59), added: 2534, mode: `MaxEncodedLen`)
/// Storage: `Balances::Locks` (r:1 w:1)
/// Proof: `Balances::Locks` (`max_values`: None, `max_size`: Some(1299), added: 3774, mode: `MaxEncodedLen`)
/// Storage: `Balances::Freezes` (r:1 w:0)
/// Proof: `Balances::Freezes` (`max_values`: None, `max_size`: Some(67), added: 2542, mode: `MaxEncodedLen`)
fn unlock() -> Weight {
// Proof Size summary in bytes:
// Measured: `11734`
// Measured: `11800`
// Estimated: `30706`
// Minimum execution time: 71_140_000 picoseconds.
Weight::from_parts(77_388_000, 30706)
// Minimum execution time: 69_473_000 picoseconds.
Weight::from_parts(71_519_000, 30706)
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(3_u64))
}