From 84f49e4141cb4f595e8b8ed52d1f515532d55264 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Fri, 3 Sep 2021 23:19:12 -0400 Subject: [PATCH 01/19] create and add baseline --- bin/node-template/runtime/src/lib.rs | 8 +- bin/node/runtime/src/lib.rs | 9 +- frame/benchmarking/src/baseline.rs | 170 +++++++++++++++++++++++++++ frame/benchmarking/src/lib.rs | 2 + 4 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 frame/benchmarking/src/baseline.rs diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index eae40e1ab3564..a15522d8ed492 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -460,12 +460,14 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); + list_benchmark!(list, extra, frame_system, BaselineBench::); list_benchmark!(list, extra, frame_system, SystemBench::); list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_timestamp, Timestamp); @@ -482,7 +484,10 @@ impl_runtime_apis! { use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; + impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -500,6 +505,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); + add_benchmark!(params, batches, baseline, BaselineBench::); add_benchmark!(params, batches, frame_system, SystemBench::); add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_timestamp, Timestamp); diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index b17bbed107db7..a32b44f5dc112 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -1549,7 +1549,7 @@ impl_runtime_apis! { Vec, Vec, ) { - use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList}; + use frame_benchmarking::{list_benchmark, baseline, Benchmarking, BenchmarkList}; use frame_support::traits::StorageInfoTrait; // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency @@ -1558,9 +1558,11 @@ impl_runtime_apis! { use pallet_session_benchmarking::Pallet as SessionBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; let mut list = Vec::::new(); + list_benchmark!(list, extra, baseline, BaselineBench::); list_benchmark!(list, extra, pallet_assets, Assets); list_benchmark!(list, extra, pallet_babe, Babe); list_benchmark!(list, extra, pallet_balances, Balances); @@ -1601,7 +1603,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; // Trying to add benchmarks directly to the Session Pallet caused cyclic dependency // issues. To get around that, we separated the Session benchmarks into its own crate, @@ -1609,10 +1611,12 @@ impl_runtime_apis! { use pallet_session_benchmarking::Pallet as SessionBench; use pallet_offences_benchmarking::Pallet as OffencesBench; use frame_system_benchmarking::Pallet as SystemBench; + use baseline::Pallet as BaselineBench; impl pallet_session_benchmarking::Config for Runtime {} impl pallet_offences_benchmarking::Config for Runtime {} impl frame_system_benchmarking::Config for Runtime {} + impl baseline::Config for Runtime {} let whitelist: Vec = vec![ // Block Number @@ -1634,6 +1638,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); + add_benchmark!(params, batches, baseline, BaselineBench::); add_benchmark!(params, batches, pallet_assets, Assets); add_benchmark!(params, batches, pallet_babe, Babe); add_benchmark!(params, batches, pallet_balances, Balances); diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs new file mode 100644 index 0000000000000..33e2b5e4f6f84 --- /dev/null +++ b/frame/benchmarking/src/baseline.rs @@ -0,0 +1,170 @@ +// This file is part of Substrate. + +// Copyright (C) 2020-2021 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. + +//! A set of benchmarks which can establish a global baseline for all other +//! benchmarking. + +use crate::{account, benchmarks, impl_benchmark_test_suite}; +use frame_system::Pallet as System; +use sp_runtime::traits::Hash; +use sp_std::prelude::*; + +const SEED: u32 = 1337; + +pub struct Pallet(System); +pub trait Config: frame_system::Config {} + +benchmarks! { + addition { + let i in 0 .. 10_000; + let mut start = 0; + }: { + (0..i).for_each(|_| start += 1); + } verify { + assert_eq!(start, i); + } + + subtraction { + let i in 0 .. 10_000; + let mut start = u32::MAX; + }: { + (0..i).for_each(|_| start -= 1); + } verify { + assert_eq!(start, u32::MAX - i); + } + + multiplication { + let i in 0 .. 10_000; + let mut out = 0; + }: { + (1..=i).for_each(|j| out = i * j); + } verify { + assert_eq!(out, i * i); + } + + division { + let i in 0 .. 10_000; + let mut out = 0; + }: { + (1..=i).for_each(|j| out = i / j); + } verify { + assert_eq!(out, i.min(1)); + } + + hashing { + let i in 0 .. 10_000; + let mut hash = T::Hash::default(); + }: { + (0..=i).for_each(|j| hash = T::Hashing::hash(&j.to_be_bytes())); + } verify { + if i > 0 { assert!(hash != T::Hash::default()); } + } + + storage_read { + let i in 0 .. 1000; + let mut people = Vec::new(); + (0..i).for_each(|j| { + let who: T::AccountId = account("user", j, SEED); + System::::inc_providers(&who); + people.push(who); + }); + }: { + people.iter().for_each(|who| { + // This does a storage read + assert!(System::::can_dec_provider(&who)); + }); + } + + storage_write { + let i in 0 .. 1000; + let mut people = Vec::new(); + (0..i).for_each(|j| { + let who: T::AccountId = account("user", j, SEED); + people.push(who); + }); + }: { + people.iter().for_each(|who| { + // This does a storage write + System::::inc_providers(&who); + }); + } verify { + people.iter().for_each(|who| { + assert!(System::::can_dec_provider(&who)); + }); + } +} + +impl_benchmark_test_suite!( + Pallet, + crate::baseline::mock::new_test_ext(), + crate::baseline::mock::Test, +); + +#[cfg(test)] +pub mod mock { + use sp_runtime::{testing::H256, traits::IdentityLookup}; + + type AccountId = u64; + type AccountIndex = u32; + type BlockNumber = u64; + + type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; + type Block = frame_system::mocking::MockBlock; + + frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + } + ); + + impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type Origin = Origin; + type Index = AccountIndex; + type BlockNumber = BlockNumber; + type Call = Call; + type Hash = H256; + type Hashing = ::sp_runtime::traits::BlakeTwo256; + type AccountId = AccountId; + type Lookup = IdentityLookup; + type Header = sp_runtime::testing::Header; + type Event = Event; + type BlockHashCount = (); + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = (); + type OnSetCode = (); + } + + impl super::Config for Test {} + + pub fn new_test_ext() -> sp_io::TestExternalities { + let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + sp_io::TestExternalities::new(t) + } +} diff --git a/frame/benchmarking/src/lib.rs b/frame/benchmarking/src/lib.rs index fb602f0732b7d..fc71a891509b2 100644 --- a/frame/benchmarking/src/lib.rs +++ b/frame/benchmarking/src/lib.rs @@ -27,6 +27,8 @@ mod tests; mod tests_instance; mod utils; +pub mod baseline; + #[cfg(feature = "std")] pub use analysis::{Analysis, AnalysisChoice, BenchmarkSelector, RegressionModel}; #[doc(hidden)] From 8af0c269e46f36e948026edbbad3437574ee1fe3 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 4 Sep 2021 14:54:18 -0400 Subject: [PATCH 02/19] fix import --- bin/node-template/runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index a15522d8ed492..e56530c7b1461 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -481,7 +481,7 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey}; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; From 10497ec9e8a85eec41c1a5869f49d0ba13dff1a5 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 4 Sep 2021 21:23:14 -0400 Subject: [PATCH 03/19] try a different name --- bin/node-template/runtime/src/lib.rs | 4 ++-- bin/node/runtime/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs index e56530c7b1461..7581cf5306f5e 100644 --- a/bin/node-template/runtime/src/lib.rs +++ b/bin/node-template/runtime/src/lib.rs @@ -467,7 +467,7 @@ impl_runtime_apis! { let mut list = Vec::::new(); - list_benchmark!(list, extra, frame_system, BaselineBench::); + list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); list_benchmark!(list, extra, frame_system, SystemBench::); list_benchmark!(list, extra, pallet_balances, Balances); list_benchmark!(list, extra, pallet_timestamp, Timestamp); @@ -505,7 +505,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - add_benchmark!(params, batches, baseline, BaselineBench::); + add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); add_benchmark!(params, batches, frame_system, SystemBench::); add_benchmark!(params, batches, pallet_balances, Balances); add_benchmark!(params, batches, pallet_timestamp, Timestamp); diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index a32b44f5dc112..9961bc75cf355 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -1562,7 +1562,7 @@ impl_runtime_apis! { let mut list = Vec::::new(); - list_benchmark!(list, extra, baseline, BaselineBench::); + list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); list_benchmark!(list, extra, pallet_assets, Assets); list_benchmark!(list, extra, pallet_babe, Babe); list_benchmark!(list, extra, pallet_balances, Balances); @@ -1638,7 +1638,7 @@ impl_runtime_apis! { let mut batches = Vec::::new(); let params = (&config, &whitelist); - add_benchmark!(params, batches, baseline, BaselineBench::); + add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); add_benchmark!(params, batches, pallet_assets, Assets); add_benchmark!(params, batches, pallet_babe, Babe); add_benchmark!(params, batches, pallet_balances, Balances); From 86eb7a099fa0177f4672206d421ac98c3829531c Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sun, 5 Sep 2021 01:28:01 +0000 Subject: [PATCH 04/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 128 ++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 frame/benchmarking/src/weights.rs diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs new file mode 100644 index 0000000000000..630ba32595fad --- /dev/null +++ b/frame/benchmarking/src/weights.rs @@ -0,0 +1,128 @@ +// This file is part of Substrate. + +// Copyright (C) 2021 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 frame_benchmarking +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2021-09-05, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// target/release/substrate +// benchmark +// --chain=dev +// --steps=50 +// --repeat=20 +// --pallet=frame_benchmarking +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --output=./frame/benchmarking/src/weights.rs +// --template=./.maintain/frame-weight-template.hbs + + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for frame_benchmarking. +pub trait WeightInfo { + fn addition(i: u32, ) -> Weight; + fn subtraction(i: u32, ) -> Weight; + fn multiplication(i: u32, ) -> Weight; + fn division(i: u32, ) -> Weight; + fn hashing(i: u32, ) -> Weight; + fn storage_read(i: u32, ) -> Weight; + fn storage_write(i: u32, ) -> Weight; +} + +/// Weights for frame_benchmarking using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + fn addition(_i: u32, ) -> Weight { + (369_000 as Weight) + } + fn subtraction(_i: u32, ) -> Weight { + (380_000 as Weight) + } + fn multiplication(_i: u32, ) -> Weight { + (377_000 as Weight) + } + fn division(_i: u32, ) -> Weight { + (372_000 as Weight) + } + fn hashing(i: u32, ) -> Weight { + (449_000 as Weight) + // Standard Error: 0 + .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) + } + // Storage: System Account (r:20 w:0) + fn storage_read(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 5_000 + .saturating_add((5_363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: System Account (r:20 w:20) + fn storage_write(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 4_000 + .saturating_add((11_822_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + fn addition(_i: u32, ) -> Weight { + (369_000 as Weight) + } + fn subtraction(_i: u32, ) -> Weight { + (380_000 as Weight) + } + fn multiplication(_i: u32, ) -> Weight { + (377_000 as Weight) + } + fn division(_i: u32, ) -> Weight { + (372_000 as Weight) + } + fn hashing(i: u32, ) -> Weight { + (449_000 as Weight) + // Standard Error: 0 + .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) + } + // Storage: System Account (r:20 w:0) + fn storage_read(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 5_000 + .saturating_add((5_363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + } + // Storage: System Account (r:20 w:20) + fn storage_write(i: u32, ) -> Weight { + (0 as Weight) + // Standard Error: 4_000 + .saturating_add((11_822_000 as Weight).saturating_mul(i as Weight)) + .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) + } +} From 7c11bcfaef1bd32d4e58635fe70367ceb2a05892 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sun, 5 Sep 2021 01:39:07 +0000 Subject: [PATCH 05/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 630ba32595fad..a9f6fd87ef7eb 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,19 +58,19 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (369_000 as Weight) + (427_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (380_000 as Weight) + (423_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (377_000 as Weight) + (418_000 as Weight) } fn division(_i: u32, ) -> Weight { - (372_000 as Weight) + (417_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (449_000 as Weight) + (2_730_000 as Weight) // Standard Error: 0 .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) } @@ -78,14 +78,14 @@ impl WeightInfo for SubstrateWeight { fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_705_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 4_000 - .saturating_add((11_822_000 as Weight).saturating_mul(i as Weight)) + (4_011_000 as Weight) + // Standard Error: 5_000 + .saturating_add((12_318_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } @@ -94,19 +94,19 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (369_000 as Weight) + (427_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (380_000 as Weight) + (423_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (377_000 as Weight) + (418_000 as Weight) } fn division(_i: u32, ) -> Weight { - (372_000 as Weight) + (417_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (449_000 as Weight) + (2_730_000 as Weight) // Standard Error: 0 .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) } @@ -114,14 +114,14 @@ impl WeightInfo for () { fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_363_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_705_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (0 as Weight) - // Standard Error: 4_000 - .saturating_add((11_822_000 as Weight).saturating_mul(i as Weight)) + (4_011_000 as Weight) + // Standard Error: 5_000 + .saturating_add((12_318_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } From 862bff875c89ae22891e8eed637cf0eff1598b6c Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sun, 5 Sep 2021 03:31:59 +0000 Subject: [PATCH 06/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index a9f6fd87ef7eb..dbec7ebe6ca7a 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (427_000 as Weight) + (382_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (423_000 as Weight) + (396_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (418_000 as Weight) + (386_000 as Weight) } fn division(_i: u32, ) -> Weight { - (417_000 as Weight) + (382_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (2_730_000 as Weight) + (0 as Weight) // Standard Error: 0 - .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((394_000 as Weight).saturating_mul(i as Weight)) } // Storage: System Account (r:20 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_705_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_445_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (4_011_000 as Weight) - // Standard Error: 5_000 - .saturating_add((12_318_000 as Weight).saturating_mul(i as Weight)) + (8_442_000 as Weight) + // Standard Error: 7_000 + .saturating_add((12_066_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } @@ -94,34 +94,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (427_000 as Weight) + (382_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (423_000 as Weight) + (396_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (418_000 as Weight) + (386_000 as Weight) } fn division(_i: u32, ) -> Weight { - (417_000 as Weight) + (382_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (2_730_000 as Weight) + (0 as Weight) // Standard Error: 0 - .saturating_add((392_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((394_000 as Weight).saturating_mul(i as Weight)) } // Storage: System Account (r:20 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_705_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_445_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (4_011_000 as Weight) - // Standard Error: 5_000 - .saturating_add((12_318_000 as Weight).saturating_mul(i as Weight)) + (8_442_000 as Weight) + // Standard Error: 7_000 + .saturating_add((12_066_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } From 8918244e14634903d686548ff5d54ddcf0458cc8 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 4 Sep 2021 23:39:38 -0400 Subject: [PATCH 07/19] increase repeats --- frame/benchmarking/src/baseline.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 33e2b5e4f6f84..229edd8c491b5 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -30,7 +30,7 @@ pub trait Config: frame_system::Config {} benchmarks! { addition { - let i in 0 .. 10_000; + let i in 0 .. 1_000_000; let mut start = 0; }: { (0..i).for_each(|_| start += 1); @@ -39,7 +39,7 @@ benchmarks! { } subtraction { - let i in 0 .. 10_000; + let i in 0 .. 1_000_000; let mut start = u32::MAX; }: { (0..i).for_each(|_| start -= 1); @@ -48,7 +48,7 @@ benchmarks! { } multiplication { - let i in 0 .. 10_000; + let i in 0 .. 1_000_000; let mut out = 0; }: { (1..=i).for_each(|j| out = i * j); @@ -57,7 +57,7 @@ benchmarks! { } division { - let i in 0 .. 10_000; + let i in 0 .. 1_000_000; let mut out = 0; }: { (1..=i).for_each(|j| out = i / j); @@ -66,7 +66,7 @@ benchmarks! { } hashing { - let i in 0 .. 10_000; + let i in 0 .. 100_000; let mut hash = T::Hash::default(); }: { (0..=i).for_each(|j| hash = T::Hashing::hash(&j.to_be_bytes())); @@ -75,7 +75,7 @@ benchmarks! { } storage_read { - let i in 0 .. 1000; + let i in 0 .. 1_000; let mut people = Vec::new(); (0..i).for_each(|j| { let who: T::AccountId = account("user", j, SEED); @@ -90,7 +90,7 @@ benchmarks! { } storage_write { - let i in 0 .. 1000; + let i in 0 .. 1_000; let mut people = Vec::new(); (0..i).for_each(|j| { let who: T::AccountId = account("user", j, SEED); From 84b38e863380b6ca427d82dbeac603ac7ec88fb8 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sun, 5 Sep 2021 03:45:13 +0000 Subject: [PATCH 08/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index dbec7ebe6ca7a..6f57b69397423 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (382_000 as Weight) + (420_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (396_000 as Weight) + (415_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (386_000 as Weight) + (409_000 as Weight) } fn division(_i: u32, ) -> Weight { - (382_000 as Weight) + (429_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (0 as Weight) + (1_059_000 as Weight) // Standard Error: 0 - .saturating_add((394_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((396_000 as Weight).saturating_mul(i as Weight)) } // Storage: System Account (r:20 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_445_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_527_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (8_442_000 as Weight) - // Standard Error: 7_000 - .saturating_add((12_066_000 as Weight).saturating_mul(i as Weight)) + (1_823_000 as Weight) + // Standard Error: 3_000 + .saturating_add((12_150_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } @@ -94,34 +94,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (382_000 as Weight) + (420_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (396_000 as Weight) + (415_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (386_000 as Weight) + (409_000 as Weight) } fn division(_i: u32, ) -> Weight { - (382_000 as Weight) + (429_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (0 as Weight) + (1_059_000 as Weight) // Standard Error: 0 - .saturating_add((394_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((396_000 as Weight).saturating_mul(i as Weight)) } // Storage: System Account (r:20 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 5_000 - .saturating_add((5_445_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((5_527_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: System Account (r:20 w:20) fn storage_write(i: u32, ) -> Weight { - (8_442_000 as Weight) - // Standard Error: 7_000 - .saturating_add((12_066_000 as Weight).saturating_mul(i as Weight)) + (1_823_000 as Weight) + // Standard Error: 3_000 + .saturating_add((12_150_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } From 0c4f3bb29e9f4e7ebcda0b16b175d340f0b14658 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 30 Oct 2021 00:57:50 +0200 Subject: [PATCH 09/19] Update baseline.rs --- frame/benchmarking/src/baseline.rs | 53 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 229edd8c491b5..69fd605c22581 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -18,12 +18,11 @@ //! A set of benchmarks which can establish a global baseline for all other //! benchmarking. -use crate::{account, benchmarks, impl_benchmark_test_suite}; +use crate::benchmarks; use frame_system::Pallet as System; use sp_runtime::traits::Hash; use sp_std::prelude::*; - -const SEED: u32 = 1337; +use codec::Encode; pub struct Pallet(System); pub trait Config: frame_system::Config {} @@ -51,18 +50,18 @@ benchmarks! { let i in 0 .. 1_000_000; let mut out = 0; }: { - (1..=i).for_each(|j| out = i * j); + (1..=i).for_each(|j| out = 2 * j); } verify { - assert_eq!(out, i * i); + assert_eq!(out, 2 * i); } division { let i in 0 .. 1_000_000; let mut out = 0; }: { - (1..=i).for_each(|j| out = i / j); + (0..=i).for_each(|j| out = j / 2); } verify { - assert_eq!(out, i.min(1)); + assert_eq!(out, i / 2); } hashing { @@ -74,45 +73,49 @@ benchmarks! { if i > 0 { assert!(hash != T::Hash::default()); } } + #[skip_meta] storage_read { let i in 0 .. 1_000; let mut people = Vec::new(); (0..i).for_each(|j| { - let who: T::AccountId = account("user", j, SEED); - System::::inc_providers(&who); - people.push(who); + let hash = T::Hashing::hash(&j.to_be_bytes()).encode(); + frame_support::storage::unhashed::put(&hash, &hash); + people.push(hash); }); }: { - people.iter().for_each(|who| { + people.iter().for_each(|hash| { // This does a storage read - assert!(System::::can_dec_provider(&who)); + let value = frame_support::storage::unhashed::get(hash); + assert_eq!(value, Some(hash.to_vec())); }); } + #[skip_meta] storage_write { let i in 0 .. 1_000; - let mut people = Vec::new(); + let mut hashes = Vec::new(); (0..i).for_each(|j| { - let who: T::AccountId = account("user", j, SEED); - people.push(who); + let hash = T::Hashing::hash(&j.to_be_bytes()); + hashes.push(hash.encode()); }); }: { - people.iter().for_each(|who| { + hashes.iter().for_each(|hash| { // This does a storage write - System::::inc_providers(&who); + frame_support::storage::unhashed::put(hash, hash); }); } verify { - people.iter().for_each(|who| { - assert!(System::::can_dec_provider(&who)); + hashes.iter().for_each(|hash| { + let value = frame_support::storage::unhashed::get(hash); + assert_eq!(value, Some(hash.to_vec())); }); } -} -impl_benchmark_test_suite!( - Pallet, - crate::baseline::mock::new_test_ext(), - crate::baseline::mock::Test, -); + impl_benchmark_test_suite!( + Pallet, + crate::baseline::mock::new_test_ext(), + crate::baseline::mock::Test, + ); +} #[cfg(test)] pub mod mock { From 97ede33a5f547eb4e8d76d3efe9bbef5ccf218c2 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 30 Oct 2021 01:05:15 +0200 Subject: [PATCH 10/19] Update baseline.rs --- frame/benchmarking/src/baseline.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 69fd605c22581..01759a59cb78d 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -19,10 +19,10 @@ //! benchmarking. use crate::benchmarks; +use codec::Encode; use frame_system::Pallet as System; use sp_runtime::traits::Hash; use sp_std::prelude::*; -use codec::Encode; pub struct Pallet(System); pub trait Config: frame_system::Config {} From eb8eafc4e3220a55b5d4dcf4279197d58732b44a Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 29 Oct 2021 23:19:17 +0000 Subject: [PATCH 11/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 56 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 6f57b69397423..9d09a9c10513e 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for frame_benchmarking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-09-05, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-10-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -58,35 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (420_000 as Weight) + (323_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (415_000 as Weight) + (325_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (409_000 as Weight) + (326_000 as Weight) } fn division(_i: u32, ) -> Weight { - (429_000 as Weight) + (328_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (1_059_000 as Weight) + (8_062_000 as Weight) // Standard Error: 0 - .saturating_add((396_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((353_000 as Weight).saturating_mul(i as Weight)) } - // Storage: System Account (r:20 w:0) + // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 5_000 - .saturating_add((5_527_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_845_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } - // Storage: System Account (r:20 w:20) + // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { - (1_823_000 as Weight) - // Standard Error: 3_000 - .saturating_add((12_150_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + (0 as Weight) + // Standard Error: 0 + .saturating_add((663_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -94,35 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (420_000 as Weight) + (323_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (415_000 as Weight) + (325_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (409_000 as Weight) + (326_000 as Weight) } fn division(_i: u32, ) -> Weight { - (429_000 as Weight) + (328_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (1_059_000 as Weight) + (8_062_000 as Weight) // Standard Error: 0 - .saturating_add((396_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((353_000 as Weight).saturating_mul(i as Weight)) } - // Storage: System Account (r:20 w:0) + // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 5_000 - .saturating_add((5_527_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_845_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } - // Storage: System Account (r:20 w:20) + // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { - (1_823_000 as Weight) - // Standard Error: 3_000 - .saturating_add((12_150_000 as Weight).saturating_mul(i as Weight)) - .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) + (0 as Weight) + // Standard Error: 0 + .saturating_add((663_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From cbf081b679d4ee1c4acb231ec709bfecce40d39c Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 29 Oct 2021 23:28:08 +0000 Subject: [PATCH 12/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 9d09a9c10513e..0c72797fb1298 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (323_000 as Weight) + (325_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (325_000 as Weight) + (330_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (326_000 as Weight) + (333_000 as Weight) } fn division(_i: u32, ) -> Weight { (328_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (8_062_000 as Weight) + (14_098_000 as Weight) // Standard Error: 0 - .saturating_add((353_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((352_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_845_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_853_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((663_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((664_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (323_000 as Weight) + (325_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (325_000 as Weight) + (330_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (326_000 as Weight) + (333_000 as Weight) } fn division(_i: u32, ) -> Weight { (328_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (8_062_000 as Weight) + (14_098_000 as Weight) // Standard Error: 0 - .saturating_add((353_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((352_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_845_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_853_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((663_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((664_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From 0ff63fc39fba8aad6ebb11834cdfc184bd81b8e5 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 29 Oct 2021 23:37:50 +0000 Subject: [PATCH 13/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 0c72797fb1298..e08e63f0f87b9 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (325_000 as Weight) + (334_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (330_000 as Weight) + (328_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (333_000 as Weight) + (322_000 as Weight) } fn division(_i: u32, ) -> Weight { - (328_000 as Weight) + (325_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (14_098_000 as Weight) + (9_042_000 as Weight) // Standard Error: 0 - .saturating_add((352_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((350_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_000 - .saturating_add((2_853_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_912_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((664_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (325_000 as Weight) + (334_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (330_000 as Weight) + (328_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (333_000 as Weight) + (322_000 as Weight) } fn division(_i: u32, ) -> Weight { - (328_000 as Weight) + (325_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (14_098_000 as Weight) + (9_042_000 as Weight) // Standard Error: 0 - .saturating_add((352_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((350_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_000 - .saturating_add((2_853_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_912_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((664_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From 3366f3c3b09c0ee7bcfe3c33b7d697c39a599864 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 29 Oct 2021 23:43:26 +0000 Subject: [PATCH 14/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index e08e63f0f87b9..7fbb3f1d1a11f 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (334_000 as Weight) + (338_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (328_000 as Weight) + (341_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (322_000 as Weight) + (338_000 as Weight) } fn division(_i: u32, ) -> Weight { - (325_000 as Weight) + (336_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (9_042_000 as Weight) + (4_779_000 as Weight) // Standard Error: 0 - .saturating_add((350_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((367_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_912_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_844_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((661_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (334_000 as Weight) + (338_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (328_000 as Weight) + (341_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (322_000 as Weight) + (338_000 as Weight) } fn division(_i: u32, ) -> Weight { - (325_000 as Weight) + (336_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (9_042_000 as Weight) + (4_779_000 as Weight) // Standard Error: 0 - .saturating_add((350_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((367_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_912_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_844_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((661_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From 1d1d101544642c578e4ee44c93c8c6adbb0ec885 Mon Sep 17 00:00:00 2001 From: Shawn Tabrizi Date: Sat, 30 Oct 2021 01:48:17 +0200 Subject: [PATCH 15/19] improve hash benchmark --- frame/benchmarking/src/baseline.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frame/benchmarking/src/baseline.rs b/frame/benchmarking/src/baseline.rs index 01759a59cb78d..a2ffca60c5cf1 100644 --- a/frame/benchmarking/src/baseline.rs +++ b/frame/benchmarking/src/baseline.rs @@ -65,12 +65,12 @@ benchmarks! { } hashing { - let i in 0 .. 100_000; + let i in 0 .. 100; let mut hash = T::Hash::default(); }: { - (0..=i).for_each(|j| hash = T::Hashing::hash(&j.to_be_bytes())); + (0..=100_000u32).for_each(|j| hash = T::Hashing::hash(&j.to_be_bytes())); } verify { - if i > 0 { assert!(hash != T::Hash::default()); } + assert!(hash != T::Hash::default()); } #[skip_meta] From 995cec689c6e9f6ce31044da530851684837b90c Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Fri, 29 Oct 2021 23:55:04 +0000 Subject: [PATCH 16/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 40 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 7fbb3f1d1a11f..3266df3bdf150 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (338_000 as Weight) + (335_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (341_000 as Weight) + (325_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (338_000 as Weight) + (331_000 as Weight) } fn division(_i: u32, ) -> Weight { - (336_000 as Weight) + (332_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (4_779_000 as Weight) - // Standard Error: 0 - .saturating_add((367_000 as Weight).saturating_mul(i as Weight)) + (35_985_285_000 as Weight) + // Standard Error: 703_000 + .saturating_add((72_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_000 - .saturating_add((2_844_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_807_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((661_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((653_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (338_000 as Weight) + (335_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (341_000 as Weight) + (325_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (338_000 as Weight) + (331_000 as Weight) } fn division(_i: u32, ) -> Weight { - (336_000 as Weight) + (332_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (4_779_000 as Weight) - // Standard Error: 0 - .saturating_add((367_000 as Weight).saturating_mul(i as Weight)) + (35_985_285_000 as Weight) + // Standard Error: 703_000 + .saturating_add((72_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 3_000 - .saturating_add((2_844_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 4_000 + .saturating_add((2_807_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((661_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((653_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From 6faad4d5f22523d4e0417a6246d42df31d77eccb Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sat, 30 Oct 2021 00:03:01 +0000 Subject: [PATCH 17/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 3266df3bdf150..97b6e2a8a38fc 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -18,7 +18,7 @@ //! Autogenerated weights for frame_benchmarking //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2021-10-29, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2021-10-30, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 // Executed Command: @@ -58,34 +58,34 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (335_000 as Weight) + (347_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (325_000 as Weight) + (350_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (331_000 as Weight) + (341_000 as Weight) } fn division(_i: u32, ) -> Weight { - (332_000 as Weight) + (336_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (35_985_285_000 as Weight) - // Standard Error: 703_000 - .saturating_add((72_000 as Weight).saturating_mul(i as Weight)) + (35_691_623_000 as Weight) + // Standard Error: 405_000 + .saturating_add((634_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 4_000 - .saturating_add((2_807_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((2_823_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((653_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((694_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +93,34 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (335_000 as Weight) + (347_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (325_000 as Weight) + (350_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (331_000 as Weight) + (341_000 as Weight) } fn division(_i: u32, ) -> Weight { - (332_000 as Weight) + (336_000 as Weight) } fn hashing(i: u32, ) -> Weight { - (35_985_285_000 as Weight) - // Standard Error: 703_000 - .saturating_add((72_000 as Weight).saturating_mul(i as Weight)) + (35_691_623_000 as Weight) + // Standard Error: 405_000 + .saturating_add((634_000 as Weight).saturating_mul(i as Weight)) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 4_000 - .saturating_add((2_807_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((2_823_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((653_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((694_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From 850cb030aefee7f3b92c5c7cbe3be35b6b932226 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sat, 30 Oct 2021 00:18:22 +0000 Subject: [PATCH 18/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 36 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 97b6e2a8a38fc..76d84ce1e7bda 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,34 +58,32 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (347_000 as Weight) + (342_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (350_000 as Weight) + (333_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (341_000 as Weight) + (324_000 as Weight) } fn division(_i: u32, ) -> Weight { - (336_000 as Weight) + (325_000 as Weight) } - fn hashing(i: u32, ) -> Weight { - (35_691_623_000 as Weight) - // Standard Error: 405_000 - .saturating_add((634_000 as Weight).saturating_mul(i as Weight)) + fn hashing(_i: u32, ) -> Weight { + (35_101_542_000 as Weight) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 4_000 - .saturating_add((2_823_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((2_800_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((694_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((658_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -93,34 +91,32 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (347_000 as Weight) + (342_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (350_000 as Weight) + (333_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (341_000 as Weight) + (324_000 as Weight) } fn division(_i: u32, ) -> Weight { - (336_000 as Weight) + (325_000 as Weight) } - fn hashing(i: u32, ) -> Weight { - (35_691_623_000 as Weight) - // Standard Error: 405_000 - .saturating_add((634_000 as Weight).saturating_mul(i as Weight)) + fn hashing(_i: u32, ) -> Weight { + (35_101_542_000 as Weight) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 4_000 - .saturating_add((2_823_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((2_800_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((694_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((658_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } From ba2decc159886e72392df90e8ac280213ce38847 Mon Sep 17 00:00:00 2001 From: Parity Bot Date: Sat, 30 Oct 2021 12:01:18 +0000 Subject: [PATCH 19/19] cargo run --quiet --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=frame_benchmarking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/benchmarking/src/weights.rs --template=./.maintain/frame-weight-template.hbs --- frame/benchmarking/src/weights.rs | 32 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/frame/benchmarking/src/weights.rs b/frame/benchmarking/src/weights.rs index 76d84ce1e7bda..807ff697fdcaa 100644 --- a/frame/benchmarking/src/weights.rs +++ b/frame/benchmarking/src/weights.rs @@ -58,32 +58,32 @@ pub trait WeightInfo { pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { fn addition(_i: u32, ) -> Weight { - (342_000 as Weight) + (337_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (333_000 as Weight) + (343_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (324_000 as Weight) + (340_000 as Weight) } fn division(_i: u32, ) -> Weight { - (325_000 as Weight) + (346_000 as Weight) } fn hashing(_i: u32, ) -> Weight { - (35_101_542_000 as Weight) + (35_449_143_000 as Weight) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_800_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_851_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((658_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } } @@ -91,32 +91,32 @@ impl WeightInfo for SubstrateWeight { // For backwards compatibility and tests impl WeightInfo for () { fn addition(_i: u32, ) -> Weight { - (342_000 as Weight) + (337_000 as Weight) } fn subtraction(_i: u32, ) -> Weight { - (333_000 as Weight) + (343_000 as Weight) } fn multiplication(_i: u32, ) -> Weight { - (324_000 as Weight) + (340_000 as Weight) } fn division(_i: u32, ) -> Weight { - (325_000 as Weight) + (346_000 as Weight) } fn hashing(_i: u32, ) -> Weight { - (35_101_542_000 as Weight) + (35_449_143_000 as Weight) } // Storage: Skipped Metadata (r:0 w:0) fn storage_read(i: u32, ) -> Weight { (0 as Weight) - // Standard Error: 4_000 - .saturating_add((2_800_000 as Weight).saturating_mul(i as Weight)) + // Standard Error: 3_000 + .saturating_add((2_851_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(i as Weight))) } // Storage: Skipped Metadata (r:0 w:0) fn storage_write(i: u32, ) -> Weight { (0 as Weight) // Standard Error: 0 - .saturating_add((658_000 as Weight).saturating_mul(i as Weight)) + .saturating_add((662_000 as Weight).saturating_mul(i as Weight)) .saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) } }