mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
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:
Generated
+50
-48
@@ -17,26 +17,28 @@
|
||||
|
||||
//! Autogenerated weights for `pallet_balances`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
|
||||
//! DATE: 2024-01-20, 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-j8vvqcjr-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
|
||||
//! 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-node
|
||||
// ./target/production/substrate-node
|
||||
// benchmark
|
||||
// pallet
|
||||
// --chain=dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pallet_balances
|
||||
// --no-storage-info
|
||||
// --no-median-slopes
|
||||
// --no-min-squares
|
||||
// --extrinsic=*
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --json-file=/builds/parity/mirrors/polkadot-sdk/.git/.artifacts/bench.json
|
||||
// --pallet=pallet_balances
|
||||
// --chain=dev
|
||||
// --header=./substrate/HEADER-APACHE2
|
||||
// --output=./substrate/frame/balances/src/weights.rs
|
||||
// --header=./substrate/HEADER-APACHE2
|
||||
// --template=./substrate/.maintain/frame-weight-template.hbs
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
@@ -69,8 +71,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 46_329_000 picoseconds.
|
||||
Weight::from_parts(47_297_000, 3593)
|
||||
// Minimum execution time: 50_062_000 picoseconds.
|
||||
Weight::from_parts(51_214_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -80,8 +82,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 36_187_000 picoseconds.
|
||||
Weight::from_parts(36_900_000, 3593)
|
||||
// Minimum execution time: 39_700_000 picoseconds.
|
||||
Weight::from_parts(40_754_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -91,8 +93,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 13_498_000 picoseconds.
|
||||
Weight::from_parts(14_143_000, 3593)
|
||||
// Minimum execution time: 14_939_000 picoseconds.
|
||||
Weight::from_parts(15_302_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -102,8 +104,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 18_756_000 picoseconds.
|
||||
Weight::from_parts(19_553_000, 3593)
|
||||
// Minimum execution time: 20_516_000 picoseconds.
|
||||
Weight::from_parts(21_179_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -113,8 +115,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `103`
|
||||
// Estimated: `6196`
|
||||
// Minimum execution time: 47_826_000 picoseconds.
|
||||
Weight::from_parts(48_834_000, 6196)
|
||||
// Minimum execution time: 51_281_000 picoseconds.
|
||||
Weight::from_parts(52_145_000, 6196)
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
@@ -124,8 +126,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 44_621_000 picoseconds.
|
||||
Weight::from_parts(45_151_000, 3593)
|
||||
// Minimum execution time: 48_988_000 picoseconds.
|
||||
Weight::from_parts(49_935_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -135,8 +137,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 16_194_000 picoseconds.
|
||||
Weight::from_parts(16_945_000, 3593)
|
||||
// Minimum execution time: 17_594_000 picoseconds.
|
||||
Weight::from_parts(18_232_000, 3593)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -147,10 +149,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0 + u * (135 ±0)`
|
||||
// Estimated: `990 + u * (2603 ±0)`
|
||||
// Minimum execution time: 15_782_000 picoseconds.
|
||||
Weight::from_parts(16_118_000, 990)
|
||||
// Standard Error: 10_499
|
||||
.saturating_add(Weight::from_parts(13_327_660, 0).saturating_mul(u.into()))
|
||||
// Minimum execution time: 16_701_000 picoseconds.
|
||||
Weight::from_parts(16_897_000, 990)
|
||||
// Standard Error: 11_684
|
||||
.saturating_add(Weight::from_parts(14_375_201, 0).saturating_mul(u.into()))
|
||||
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(u.into())))
|
||||
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(u.into())))
|
||||
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
|
||||
@@ -159,8 +161,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 6_157_000 picoseconds.
|
||||
Weight::from_parts(6_507_000, 0)
|
||||
// Minimum execution time: 6_692_000 picoseconds.
|
||||
Weight::from_parts(7_140_000, 0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,8 +174,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 46_329_000 picoseconds.
|
||||
Weight::from_parts(47_297_000, 3593)
|
||||
// Minimum execution time: 50_062_000 picoseconds.
|
||||
Weight::from_parts(51_214_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -183,8 +185,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 36_187_000 picoseconds.
|
||||
Weight::from_parts(36_900_000, 3593)
|
||||
// Minimum execution time: 39_700_000 picoseconds.
|
||||
Weight::from_parts(40_754_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -194,8 +196,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 13_498_000 picoseconds.
|
||||
Weight::from_parts(14_143_000, 3593)
|
||||
// Minimum execution time: 14_939_000 picoseconds.
|
||||
Weight::from_parts(15_302_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -205,8 +207,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 18_756_000 picoseconds.
|
||||
Weight::from_parts(19_553_000, 3593)
|
||||
// Minimum execution time: 20_516_000 picoseconds.
|
||||
Weight::from_parts(21_179_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -216,8 +218,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `103`
|
||||
// Estimated: `6196`
|
||||
// Minimum execution time: 47_826_000 picoseconds.
|
||||
Weight::from_parts(48_834_000, 6196)
|
||||
// Minimum execution time: 51_281_000 picoseconds.
|
||||
Weight::from_parts(52_145_000, 6196)
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
@@ -227,8 +229,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 44_621_000 picoseconds.
|
||||
Weight::from_parts(45_151_000, 3593)
|
||||
// Minimum execution time: 48_988_000 picoseconds.
|
||||
Weight::from_parts(49_935_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -238,8 +240,8 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `174`
|
||||
// Estimated: `3593`
|
||||
// Minimum execution time: 16_194_000 picoseconds.
|
||||
Weight::from_parts(16_945_000, 3593)
|
||||
// Minimum execution time: 17_594_000 picoseconds.
|
||||
Weight::from_parts(18_232_000, 3593)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
@@ -250,10 +252,10 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0 + u * (135 ±0)`
|
||||
// Estimated: `990 + u * (2603 ±0)`
|
||||
// Minimum execution time: 15_782_000 picoseconds.
|
||||
Weight::from_parts(16_118_000, 990)
|
||||
// Standard Error: 10_499
|
||||
.saturating_add(Weight::from_parts(13_327_660, 0).saturating_mul(u.into()))
|
||||
// Minimum execution time: 16_701_000 picoseconds.
|
||||
Weight::from_parts(16_897_000, 990)
|
||||
// Standard Error: 11_684
|
||||
.saturating_add(Weight::from_parts(14_375_201, 0).saturating_mul(u.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(u.into())))
|
||||
.saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(u.into())))
|
||||
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(u.into()))
|
||||
@@ -262,7 +264,7 @@ impl WeightInfo for () {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 6_157_000 picoseconds.
|
||||
Weight::from_parts(6_507_000, 0)
|
||||
// Minimum execution time: 6_692_000 picoseconds.
|
||||
Weight::from_parts(7_140_000, 0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user