Skip to content

Commit

Permalink
Benchmarking: Calculate weights for c5265d4 (#347)
Browse files Browse the repository at this point in the history
* [ci] calculate weights

* change(kreivo-runtime): attach benchmarked weights with runtime config

* fix(github:workflows): prevent re-running benchmarking if there are already changes in the runtime's `weights` directory

* change(pallet-payments): update reference weights

* fix(github:workflows): use negative inclusion of weights' paths

---------

Co-authored-by: pandres95 <[email protected]>
Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2024
1 parent c5265d4 commit cdf5569
Show file tree
Hide file tree
Showing 8 changed files with 474 additions and 128 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
paths:
- '!runtime/kreivo/src/weights/**'

jobs:
build:
Expand Down
280 changes: 155 additions & 125 deletions pallets/payments/src/weights.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions runtime/kreivo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl pallet_burner::Config for Runtime {
type BurnDestination = ();
type BurnOrigin = frame_system::EnsureRoot<Self::AccountId>;
type PalletId = BurnerPalletId;
type WeightInfo = pallet_burner::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::pallet_burner::WeightInfo<Runtime>;
}

/// We allow root and the StakingAdmin to execute privileged collator selection
Expand Down Expand Up @@ -673,7 +673,7 @@ impl pallet_asset_registry::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ReserveAssetModifierOrigin = frame_system::EnsureRoot<Self::AccountId>;
type Assets = Assets;
type WeightInfo = pallet_asset_registry::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::pallet_asset_registry::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = AssetRegistryBenchmarkHelper;
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/kreivo/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl pallet_payments::Config for Runtime {
type Preimages = Preimage;
type CancelBufferBlockLength = ConstU32<14400>; // 2 days
type PalletsOrigin = OriginCaller;
type WeightInfo = pallet_payments::weights::SubstrateWeight<Runtime>;
type WeightInfo = crate::weights::pallet_payments::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = PaymentsBenchmarkHelper;
}
3 changes: 3 additions & 0 deletions runtime/kreivo/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
pub mod block_weights;
pub mod extrinsic_weights;
pub mod pallet_asset_registry;
pub mod pallet_assets;
pub mod pallet_burner;
pub mod pallet_payments;
pub mod pallet_proxy;
pub mod paritydb_weights;
pub mod rocksdb_weights;
Expand Down
68 changes: 68 additions & 0 deletions runtime/kreivo/src/weights/pallet_asset_registry.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

//! Autogenerated weights for `pallet_asset_registry`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-03-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `virto-builder`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("kreivo-local")`, DB CACHE: 1024
// Executed Command:
// ./target/release/virto-node
// benchmark
// pallet
// --chain
// kreivo-local
// --pallet
// pallet_asset_registry
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output
// runtime/kreivo/src/weights/pallet_asset_registry.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `pallet_asset_registry`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_asset_registry::WeightInfo for WeightInfo<T> {
/// Storage: `Assets::Asset` (r:1 w:0)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `AssetRegistry::AssetIdMultiLocation` (r:1 w:1)
/// Proof: `AssetRegistry::AssetIdMultiLocation` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`)
/// Storage: `AssetRegistry::AssetMultiLocationId` (r:0 w:1)
/// Proof: `AssetRegistry::AssetMultiLocationId` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`)
fn register_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `123`
// Estimated: `4087`
// Minimum execution time: 52_891_000 picoseconds.
Weight::from_parts(58_290_000, 0)
.saturating_add(Weight::from_parts(0, 4087))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `AssetRegistry::AssetIdMultiLocation` (r:1 w:1)
/// Proof: `AssetRegistry::AssetIdMultiLocation` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`)
/// Storage: `AssetRegistry::AssetMultiLocationId` (r:0 w:1)
/// Proof: `AssetRegistry::AssetMultiLocationId` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`)
fn unregister_reserve_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `107`
// Estimated: `4087`
// Minimum execution time: 37_218_000 picoseconds.
Weight::from_parts(43_426_000, 0)
.saturating_add(Weight::from_parts(0, 4087))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
}
}
46 changes: 46 additions & 0 deletions runtime/kreivo/src/weights/pallet_burner.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

//! Autogenerated weights for `pallet_burner`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-03-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `virto-builder`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("kreivo-local")`, DB CACHE: 1024
// Executed Command:
// ./target/release/virto-node
// benchmark
// pallet
// --chain
// kreivo-local
// --pallet
// pallet_burner
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output
// runtime/kreivo/src/weights/pallet_burner.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `pallet_burner`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_burner::WeightInfo for WeightInfo<T> {
fn burn_asset() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 43_941_000 picoseconds.
Weight::from_parts(60_738_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}
}
197 changes: 197 additions & 0 deletions runtime/kreivo/src/weights/pallet_payments.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@

//! Autogenerated weights for `pallet_payments`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-03-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `virto-builder`, CPU: `Intel(R) Xeon(R) Silver 4216 CPU @ 2.10GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("kreivo-local")`, DB CACHE: 1024
// Executed Command:
// ./target/release/virto-node
// benchmark
// pallet
// --chain
// kreivo-local
// --pallet
// pallet_payments
// --extrinsic
// *
// --steps
// 50
// --repeat
// 20
// --output
// runtime/kreivo/src/weights/pallet_payments.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;

/// Weight functions for `pallet_payments`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_payments::WeightInfo for WeightInfo<T> {
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Holds` (r:2 w:2)
/// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(969), added: 3444, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:1)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `Payments::PaymentParties` (r:0 w:1)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
/// The range of component `q` is `[1, 50]`.
fn pay(_q: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `508`
// Estimated: `8504`
// Minimum execution time: 147_384_000 picoseconds.
Weight::from_parts(255_579_375, 0)
.saturating_add(Weight::from_parts(0, 8504))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:3 w:3)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `Assets::Holds` (r:2 w:2)
/// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(969), added: 3444, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn release() -> Weight {
// Proof Size summary in bytes:
// Measured: `1114`
// Estimated: `8817`
// Minimum execution time: 370_232_000 picoseconds.
Weight::from_parts(406_256_000, 0)
.saturating_add(Weight::from_parts(0, 8817))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(8))
}
/// Storage: `Payments::PaymentParties` (r:1 w:1)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `Assets::Holds` (r:2 w:2)
/// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(969), added: 3444, mode: `MaxEncodedLen`)
fn cancel() -> Weight {
// Proof Size summary in bytes:
// Measured: `1081`
// Estimated: `8504`
// Minimum execution time: 248_088_000 picoseconds.
Weight::from_parts(321_368_000, 0)
.saturating_add(Weight::from_parts(0, 8504))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(7))
}
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Lookup` (r:1 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`)
fn request_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `342`
// Estimated: `159279`
// Minimum execution time: 80_932_000 picoseconds.
Weight::from_parts(94_860_000, 0)
.saturating_add(Weight::from_parts(0, 159279))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Payments::PaymentParties` (r:1 w:0)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Holds` (r:1 w:1)
/// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(969), added: 3444, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:1 w:1)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Lookup` (r:1 w:1)
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
/// Storage: `Scheduler::Agenda` (r:1 w:1)
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(155814), added: 158289, mode: `MaxEncodedLen`)
fn dispute_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `1183`
// Estimated: `159279`
// Minimum execution time: 216_975_000 picoseconds.
Weight::from_parts(229_587_000, 0)
.saturating_add(Weight::from_parts(0, 159279))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: `Payments::PaymentParties` (r:1 w:0)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:3 w:3)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `Assets::Holds` (r:2 w:2)
/// Proof: `Assets::Holds` (`max_values`: None, `max_size`: Some(969), added: 3444, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn resolve_dispute() -> Weight {
// Proof Size summary in bytes:
// Measured: `1184`
// Estimated: `8817`
// Minimum execution time: 523_988_000 picoseconds.
Weight::from_parts(558_013_000, 0)
.saturating_add(Weight::from_parts(0, 8817))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(8))
}
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:0)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Payments::PaymentParties` (r:0 w:1)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
fn request_payment() -> Weight {
// Proof Size summary in bytes:
// Measured: `356`
// Estimated: `8504`
// Minimum execution time: 63_907_000 picoseconds.
Weight::from_parts(68_445_000, 0)
.saturating_add(Weight::from_parts(0, 8504))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Payments::PaymentParties` (r:1 w:0)
/// Proof: `Payments::PaymentParties` (`max_values`: None, `max_size`: Some(80), added: 2555, mode: `MaxEncodedLen`)
/// Storage: `Payments::Payment` (r:1 w:1)
/// Proof: `Payments::Payment` (`max_values`: None, `max_size`: Some(5039), added: 7514, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:3 w:3)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn accept_and_pay() -> Weight {
// Proof Size summary in bytes:
// Measured: `977`
// Estimated: `8817`
// Minimum execution time: 329_075_000 picoseconds.
Weight::from_parts(342_783_000, 0)
.saturating_add(Weight::from_parts(0, 8817))
.saturating_add(T::DbWeight::get().reads(7))
.saturating_add(T::DbWeight::get().writes(6))
}
}

0 comments on commit cdf5569

Please sign in to comment.