From ea9f4a813e68f9d3bfb2e2559a08727422125836 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Sat, 11 Jun 2022 23:10:45 +0200 Subject: [PATCH] =?UTF-8?q?feat(weights):=C2=A0use=20our=20benchmarks=20fo?= =?UTF-8?q?r=20frame=5Fsystem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/common/src/pallets_config.rs | 2 +- runtime/common/src/weights.rs | 1 + runtime/common/src/weights/frame_system.rs | 84 ++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 runtime/common/src/weights/frame_system.rs diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index 4f0bd34cf..734ecb9a3 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -69,7 +69,7 @@ macro_rules! pallets_config { /// The data to be stored in an account. type AccountData = pallet_duniter_account::AccountData<Balance>; /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight<Runtime>; + type SystemWeightInfo = common_runtime::weights::frame_system::WeightInfo<Runtime>; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; /// The set code logic, just the default since we're not a parachain. diff --git a/runtime/common/src/weights.rs b/runtime/common/src/weights.rs index 422ca3ffa..67dca2777 100644 --- a/runtime/common/src/weights.rs +++ b/runtime/common/src/weights.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>. +pub mod frame_system; pub mod pallet_babe; pub mod pallet_balances; pub mod pallet_grandpa; diff --git a/runtime/common/src/weights/frame_system.rs b/runtime/common/src/weights/frame_system.rs new file mode 100644 index 000000000..3c8eda2eb --- /dev/null +++ b/runtime/common/src/weights/frame_system.rs @@ -0,0 +1,84 @@ +// Copyright 2021-2022 Axiom-Team +// +// This file is part of Duniter-v2S. +// +// Duniter-v2S is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, version 3 of the License. +// +// Duniter-v2S is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. + +//! Autogenerated weights for `frame_system` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-06-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ./duniter +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=frame_system +// --extrinsic=* +// --execution=wasm +// --wasm-execution=interpreted-i-know-what-i-do +// --heap-pages=4096 +// --output=. + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `frame_system`. +pub struct WeightInfo<T>(PhantomData<T>); +impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { + fn remark(b: u32, ) -> Weight { + (56_698_000 as Weight) + // Standard Error: 0 + .saturating_add((238_000 as Weight).saturating_mul(b as Weight)) + } + fn remark_with_event(b: u32, ) -> Weight { + (1_830_806_000 as Weight) + // Standard Error: 0 + .saturating_add((254_000 as Weight).saturating_mul(b as Weight)) + } + // Storage: System Digest (r:1 w:1) + // Storage: unknown [0x3a686561707061676573] (r:0 w:1) + fn set_heap_pages() -> Weight { + (74_351_000 as Weight) + .saturating_add(T::DbWeight::get().reads(1 as Weight)) + .saturating_add(T::DbWeight::get().writes(2 as Weight)) + } + // Storage: Skipped Metadata (r:0 w:0) + fn set_storage(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 26_000 + .saturating_add((38_883_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_storage(i: u32, ) -> Weight { + (14_386_000 as Weight) + // Standard Error: 16_000 + .saturating_add((18_658_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: Skipped Metadata (r:0 w:0) + fn kill_prefix(p: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 8_000 + .saturating_add((6_532_000 as Weight).saturating_mul(p as Weight)) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) + } +} -- GitLab