Skip to content

Commit

Permalink
fix bench + update all runtimes/pallet weights
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocryk committed Dec 11, 2024
1 parent 45e55ec commit c234110
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 82 deletions.
8 changes: 6 additions & 2 deletions pallets/author-noting/src/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ mod test_sproof {
benchmarks! {
set_latest_author_data {
// Depend on the number of parachains registered
let x in 0..100;
let x in 1..100;
let mut container_chains = vec![];

let data = if TypeId::of::<<<T as Config>::RelayOrPara as RelayOrPara>::InherentArg>() == TypeId::of::<tp_author_noting_inherent::OwnParachainInherentData>() {
// RELAY MODE
let mut sproof_builder = test_sproof::ParaHeaderSproofBuilder::default();

// Must start at 0 in Relay mode (why?)
for para_id in 0..x {
let para_id = para_id.into();
container_chains.push(para_id);
Expand Down Expand Up @@ -92,8 +94,10 @@ benchmarks! {

*(Box::new(arg) as Box<dyn Any>).downcast().unwrap()
} else if TypeId::of::<<<T as Config>::RelayOrPara as RelayOrPara>::InherentArg>() == TypeId::of::<()>() {
// PARA MODE

for para_id in 0..x {
// Must start at 1 in Para mode (why?)
for para_id in 1..x {
let slot: crate::InherentType = 13u64.into();
let header = sp_runtime::generic::Header::<crate::BlockNumber, crate::BlakeTwo256> {
parent_hash: Default::default(),
Expand Down
54 changes: 27 additions & 27 deletions pallets/author-noting/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_author_noting
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
//! DATE: 2024-12-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-12-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
Expand Down Expand Up @@ -86,16 +86,16 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:100)
/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
/// The range of component `x` is `[0, 100]`.
/// The range of component `x` is `[1, 100]`.
fn set_latest_author_data(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `1008 + x * (208 ±0)`
// Measured: `1015 + x * (208 ±0)`
// Estimated: `8799 + x * (2603 ±0)`
// Minimum execution time: 8_650_000 picoseconds.
Weight::from_parts(8_895_000, 8799)
// Standard Error: 187_287
.saturating_add(Weight::from_parts(41_591_545, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(11_u64))
// Minimum execution time: 122_225_000 picoseconds.
Weight::from_parts(123_639_000, 8799)
// Standard Error: 128_105
.saturating_add(Weight::from_parts(36_913_982, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(12_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into())))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into())))
Expand All @@ -107,8 +107,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_684_000 picoseconds.
Weight::from_parts(6_177_000, 0)
// Minimum execution time: 5_776_000 picoseconds.
Weight::from_parts(6_057_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
Expand All @@ -117,8 +117,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_468_000 picoseconds.
Weight::from_parts(5_887_000, 0)
// Minimum execution time: 5_542_000 picoseconds.
Weight::from_parts(5_844_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
Expand All @@ -137,8 +137,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Proof Size summary in bytes:
// Measured: `881`
// Estimated: `11402`
// Minimum execution time: 92_961_000 picoseconds.
Weight::from_parts(94_977_000, 11402)
// Minimum execution time: 92_792_000 picoseconds.
Weight::from_parts(99_983_000, 11402)
.saturating_add(T::DbWeight::get().reads(9_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
Expand Down Expand Up @@ -170,16 +170,16 @@ impl WeightInfo for () {
/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:100)
/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
/// The range of component `x` is `[0, 100]`.
/// The range of component `x` is `[1, 100]`.
fn set_latest_author_data(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `1008 + x * (208 ±0)`
// Measured: `1015 + x * (208 ±0)`
// Estimated: `8799 + x * (2603 ±0)`
// Minimum execution time: 8_650_000 picoseconds.
Weight::from_parts(8_895_000, 8799)
// Standard Error: 187_287
.saturating_add(Weight::from_parts(41_591_545, 0).saturating_mul(x.into()))
.saturating_add(RocksDbWeight::get().reads(11_u64))
// Minimum execution time: 122_225_000 picoseconds.
Weight::from_parts(123_639_000, 8799)
// Standard Error: 128_105
.saturating_add(Weight::from_parts(36_913_982, 0).saturating_mul(x.into()))
.saturating_add(RocksDbWeight::get().reads(12_u64))
.saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(x.into())))
.saturating_add(RocksDbWeight::get().writes(4_u64))
.saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(x.into())))
Expand All @@ -191,8 +191,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_684_000 picoseconds.
Weight::from_parts(6_177_000, 0)
// Minimum execution time: 5_776_000 picoseconds.
Weight::from_parts(6_057_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
Expand All @@ -201,8 +201,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_468_000 picoseconds.
Weight::from_parts(5_887_000, 0)
// Minimum execution time: 5_542_000 picoseconds.
Weight::from_parts(5_844_000, 0)
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
Expand All @@ -221,8 +221,8 @@ impl WeightInfo for () {
// Proof Size summary in bytes:
// Measured: `881`
// Estimated: `11402`
// Minimum execution time: 92_961_000 picoseconds.
Weight::from_parts(94_977_000, 11402)
// Minimum execution time: 92_792_000 picoseconds.
Weight::from_parts(99_983_000, 11402)
.saturating_add(RocksDbWeight::get().reads(9_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
Expand Down
28 changes: 14 additions & 14 deletions runtime/dancebox/src/weights/pallet_author_noting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for pallet_author_noting
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
//! DATE: 2024-12-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-12-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
Expand Down Expand Up @@ -78,16 +78,16 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
/// Proof: `PooledStaking::Pools` (`max_values`: None, `max_size`: Some(113), added: 2588, mode: `MaxEncodedLen`)
/// Storage: `XcmCoreBuyer::PendingBlocks` (r:0 w:100)
/// Proof: `XcmCoreBuyer::PendingBlocks` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`)
/// The range of component `x` is `[0, 100]`.
/// The range of component `x` is `[1, 100]`.
fn set_latest_author_data(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `1008 + x * (208 ±0)`
// Measured: `1015 + x * (208 ±0)`
// Estimated: `8799 + x * (2603 ±0)`
// Minimum execution time: 8_650_000 picoseconds.
Weight::from_parts(8_895_000, 8799)
// Standard Error: 187_287
.saturating_add(Weight::from_parts(41_591_545, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(11_u64))
// Minimum execution time: 122_225_000 picoseconds.
Weight::from_parts(123_639_000, 8799)
// Standard Error: 128_105
.saturating_add(Weight::from_parts(36_913_982, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(12_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into())))
.saturating_add(T::DbWeight::get().writes(4_u64))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into())))
Expand All @@ -99,8 +99,8 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_684_000 picoseconds.
Weight::from_parts(6_177_000, 0)
// Minimum execution time: 5_776_000 picoseconds.
Weight::from_parts(6_057_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
Expand All @@ -109,8 +109,8 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 5_468_000 picoseconds.
Weight::from_parts(5_887_000, 0)
// Minimum execution time: 5_542_000 picoseconds.
Weight::from_parts(5_844_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
Expand All @@ -129,8 +129,8 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
// Proof Size summary in bytes:
// Measured: `881`
// Estimated: `11402`
// Minimum execution time: 92_961_000 picoseconds.
Weight::from_parts(94_977_000, 11402)
// Minimum execution time: 92_792_000 picoseconds.
Weight::from_parts(99_983_000, 11402)
.saturating_add(T::DbWeight::get().reads(9_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
Expand Down
67 changes: 46 additions & 21 deletions runtime/flashbox/src/weights/pallet_author_noting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

//! Autogenerated weights for pallet_author_noting
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-08-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
//! DATE: 2024-12-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `benchmark-1`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("flashbox_dev"), DB CACHE: 1024
// Executed Command:
Expand All @@ -38,7 +38,7 @@
// 50
// --repeat
// 20
// --template=benchmarking/frame-weight-runtime-template.hbs
// --template=./benchmarking/frame-weight-pallet-template.hbs
// --json-file
// raw.json
// --output
Expand All @@ -57,7 +57,7 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
/// Storage: `AuthorNoting::DidSetContainerAuthorData` (r:1 w:1)
/// Proof: `AuthorNoting::DidSetContainerAuthorData` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`)
/// Storage: `Registrar::RegisteredParaIds` (r:1 w:0)
/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Proof: `Registrar::RegisteredParaIds` (`max_values`: Some(1), `max_size`: Some(802), added: 1297, mode: `MaxEncodedLen`)
/// Storage: `ParachainSystem::ValidationData` (r:1 w:0)
/// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `System::Digest` (r:1 w:0)
Expand All @@ -66,29 +66,37 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
/// Proof: `CollatorAssignment::CollatorContainerChain` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `AuthorNoting::LatestAuthor` (r:100 w:100)
/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
/// The range of component `x` is `[0, 100]`.
/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(818), added: 1313, mode: `MaxEncodedLen`)
/// Storage: `ServicesPayment::BlockProductionCredits` (r:100 w:0)
/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:101 w:101)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(6402), added: 6897, mode: `MaxEncodedLen`)
/// The range of component `x` is `[1, 100]`.
fn set_latest_author_data(x: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `393 + x * (73 ±0)`
// Estimated: `1878 + x * (2539 ±0)`
// Minimum execution time: 9_515_000 picoseconds.
Weight::from_parts(9_708_000, 1878)
// Standard Error: 152_038
.saturating_add(Weight::from_parts(23_061_887, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into())))
.saturating_add(T::DbWeight::get().writes(1_u64))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(x.into())))
.saturating_add(Weight::from_parts(0, 2539).saturating_mul(x.into()))
// Measured: `854 + x * (208 ±0)`
// Estimated: `7887 + x * (2603 ±0)`
// Minimum execution time: 83_801_000 picoseconds.
Weight::from_parts(85_905_000, 7887)
// Standard Error: 173_939
.saturating_add(Weight::from_parts(38_237_286, 0).saturating_mul(x.into()))
.saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into())))
.saturating_add(T::DbWeight::get().writes(3_u64))
.saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(x.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(x.into()))
}
/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
/// Proof: `AuthorNoting::LatestAuthor` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
fn set_author() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_380_000 picoseconds.
Weight::from_parts(7_628_000, 0)
// Minimum execution time: 6_026_000 picoseconds.
Weight::from_parts(6_250_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `AuthorNoting::LatestAuthor` (r:0 w:1)
Expand All @@ -97,8 +105,25 @@ impl<T: frame_system::Config> pallet_author_noting::WeightInfo for SubstrateWeig
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 7_055_000 picoseconds.
Weight::from_parts(7_251_000, 0)
// Minimum execution time: 5_454_000 picoseconds.
Weight::from_parts(5_660_000, 0)
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `InflationRewards::ChainsToReward` (r:1 w:1)
/// Proof: `InflationRewards::ChainsToReward` (`max_values`: Some(1), `max_size`: Some(818), added: 1313, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Invulnerables::Invulnerables` (r:1 w:0)
/// Proof: `Invulnerables::Invulnerables` (`max_values`: Some(1), `max_size`: Some(6402), added: 6897, mode: `MaxEncodedLen`)
/// Storage: `ServicesPayment::BlockProductionCredits` (r:1 w:0)
/// Proof: `ServicesPayment::BlockProductionCredits` (`max_values`: None, `max_size`: Some(24), added: 2499, mode: `MaxEncodedLen`)
fn on_container_author_noted() -> Weight {
// Proof Size summary in bytes:
// Measured: `647`
// Estimated: `7887`
// Minimum execution time: 51_807_000 picoseconds.
Weight::from_parts(53_926_000, 7887)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(3_u64))
}
}
Loading

0 comments on commit c234110

Please sign in to comment.