Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
add benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
José Molina committed Dec 5, 2023
1 parent 404f665 commit 588f066
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 4 deletions.
9 changes: 5 additions & 4 deletions runtime/trappist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use frame_support::{
pub use frame_system::Call as SystemCall;
use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot, EnsureRootWithSuccess, EnsureSigned,
EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureWithSuccess,
};
use pallet_identity::simple::IdentityInfo;
use pallet_tx_pause::RuntimeCallNameOf;
Expand Down Expand Up @@ -528,7 +528,7 @@ parameter_types! {

impl pallet_preimage::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::pallet_preimage::WeightInfo<Runtime>;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type Consideration = ();
Expand Down Expand Up @@ -644,6 +644,7 @@ parameter_types! {
// The asset's interior location for the paying account. This is the Treasury
// pallet instance (which sits at index 61).
pub TreasuryInteriorLocation: InteriorMultiLocation = PalletInstance(61).into();
pub const MaxBalance: Balance = Balance::max_value();
}

impl pallet_treasury::Config for Runtime {
Expand All @@ -662,7 +663,7 @@ impl pallet_treasury::Config for Runtime {
type WeightInfo = pallet_treasury::weights::SubstrateWeight<Runtime>;
type SpendFunds = ();
type MaxApprovals = MaxApprovals;
type SpendOrigin = frame_support::traits::NeverEnsureOrigin<Balance>;
type SpendOrigin = EnsureWithSuccess<EnsureRoot<AccountId>, AccountId, MaxBalance>;
type AssetKind = VersionedLocatableAsset;
type Beneficiary = VersionedMultiLocation;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
Expand Down Expand Up @@ -724,7 +725,7 @@ impl pallet_safe_mode::Config for Runtime {
type ForceDepositOrigin = EnsureRoot<AccountId>;
type Notify = ();
type ReleaseDelay = ReleaseDelay;
type WeightInfo = pallet_safe_mode::weights::SubstrateWeight<Runtime>;
type WeightInfo = weights::pallet_safe_mode::WeightInfo<Runtime>;
}

/// Calls that cannot be paused by the tx-pause pallet.
Expand Down
2 changes: 2 additions & 0 deletions runtime/trappist/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ pub mod pallet_contracts;
pub mod pallet_democracy;
pub mod pallet_identity;
pub mod pallet_multisig;
pub mod pallet_preimage;
pub mod pallet_safe_mode;
pub mod pallet_scheduler;
pub mod pallet_session;
pub mod pallet_timestamp;
Expand Down
262 changes: 262 additions & 0 deletions runtime/trappist/src/weights/pallet_preimage.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
// This file is part of Trappist.

// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// 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
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Autogenerated weights for `pallet_preimage`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 29.0.0
//! DATE: 2023-12-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `PAR03651`, CPU: `<UNKNOWN>`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("trappist-dev")`, DB CACHE: 1024
// Executed Command:
// ./target/production/trappist-node
// benchmark
// pallet
// --chain=trappist-dev
// --steps=50
// --repeat=20
// --no-storage-info
// --no-median-slopes
// --no-min-squares
// --pallet=pallet_preimage
// --extrinsic=*
// --wasm-execution=compiled
// --header=./templates/file_header.txt
// --output=./runtime/trappist/src/weights/

#![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_preimage`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_preimage::WeightInfo for WeightInfo<T> {
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 4194304]`.
fn note_preimage(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3556`
// Minimum execution time: 7_000_000 picoseconds.
Weight::from_parts(8_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
// Standard Error: 1
.saturating_add(Weight::from_parts(1_317, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 4194304]`.
fn note_requested_preimage(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3556`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(9_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
// Standard Error: 1
.saturating_add(Weight::from_parts(1_312, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
/// The range of component `s` is `[0, 4194304]`.
fn note_no_deposit_preimage(s: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3556`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(10_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
// Standard Error: 1
.saturating_add(Weight::from_parts(1_311, 0).saturating_mul(s.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
fn unnote_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `172`
// Estimated: `3556`
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(11_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
fn unnote_no_deposit_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `144`
// Estimated: `3556`
// Minimum execution time: 11_000_000 picoseconds.
Weight::from_parts(13_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn request_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `172`
// Estimated: `3556`
// Minimum execution time: 9_000_000 picoseconds.
Weight::from_parts(9_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn request_no_deposit_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `144`
// Estimated: `3556`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn request_unnoted_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `42`
// Estimated: `3556`
// Minimum execution time: 7_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn request_requested_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3556`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// Storage: `Preimage::PreimageFor` (r:0 w:1)
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `MaxEncodedLen`)
fn unrequest_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `144`
// Estimated: `3556`
// Minimum execution time: 10_000_000 picoseconds.
Weight::from_parts(11_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn unrequest_unnoted_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3556`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(6_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
fn unrequest_multi_referenced_preimage() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3556`
// Minimum execution time: 6_000_000 picoseconds.
Weight::from_parts(7_000_000, 0)
.saturating_add(Weight::from_parts(0, 3556))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Preimage::StatusFor` (r:1023 w:1023)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1023 w:1023)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:0 w:1023)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(75), added: 2550, mode: `MaxEncodedLen`)
/// The range of component `n` is `[1, 1024]`.
fn ensure_updated(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0 + n * (227 ±0)`
// Estimated: `990 + n * (2603 ±0)`
// Minimum execution time: 12_000_000 picoseconds.
Weight::from_parts(13_000_000, 0)
.saturating_add(Weight::from_parts(0, 990))
// Standard Error: 16_909
.saturating_add(Weight::from_parts(12_823_569, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2603).saturating_mul(n.into()))
}
}
Loading

0 comments on commit 588f066

Please sign in to comment.