From fb7facde34f5096b36b64b317739f63c6adb7392 Mon Sep 17 00:00:00 2001 From: Igor Kozyrev Date: Fri, 28 Oct 2022 15:13:36 +0000 Subject: [PATCH] fix: bench scheduler v2 --- --- a/pallets/scheduler-v2/src/weights.rs +++ b/pallets/scheduler-v2/src/weights.rs @@ -1,72 +1,42 @@ -// Copyright 2019-2022 Unique Network (Gibraltar) Ltd. -// This file is part of Unique Network. - -// Unique Network is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Unique Network 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 General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Unique Network. If not, see . - -// Original license: -// This file is part of Substrate. +// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs -// Copyright (C) 2022 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_scheduler +//! Autogenerated weights for pallet_unique_scheduler_v2 //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm3`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 +//! DATE: 2022-10-28, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024 // Executed Command: -// /home/benchbot/cargo_target_dir/production/substrate +// target/release/unique-collator // benchmark // pallet +// --pallet +// pallet-unique-scheduler-v2 +// --wasm-execution +// compiled +// --extrinsic +// * +// --template +// .maintain/frame-weight-template.hbs // --steps=50 -// --repeat=20 -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled +// --repeat=80 // --heap-pages=4096 -// --pallet=pallet_scheduler -// --chain=dev -// --output=./frame/scheduler/src/weights.rs -// --template=./.maintain/frame-weight-template.hbs +// --output=./pallets/scheduler-v2/src/weights.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] +#![allow(clippy::unnecessary_cast)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use sp_std::marker::PhantomData; -/// Weight functions needed for pallet_scheduler. +/// Weight functions needed for pallet_unique_scheduler_v2. pub trait WeightInfo { fn service_agendas_base() -> Weight; fn service_agenda_base(s: u32, ) -> Weight; fn service_task_base() -> Weight; - fn service_task_fetched(s: u32, ) -> Weight; fn service_task_named() -> Weight; fn service_task_periodic() -> Weight; fn execute_dispatch_signed() -> Weight; @@ -78,99 +48,96 @@ fn change_named_priority(s: u32, ) -> Weight; } -/// Weights for pallet_scheduler using the Substrate node and recommended hardware. +/// Weights for pallet_unique_scheduler_v2 using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); impl WeightInfo for SubstrateWeight { // Storage: Scheduler IncompleteSince (r:1 w:1) fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_992_000 as u64) + Weight::from_ref_time(5_253_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 512]`. fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(4_320_000 as u64) - // Standard Error: 619 - .saturating_add(Weight::from_ref_time(336_713 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(3_858_000 as u64) + // Standard Error: 2_617 + .saturating_add(Weight::from_ref_time(579_704 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: System LastRuntimeUpgrade (r:1 w:0) fn service_task_base() -> Weight { - Weight::from_ref_time(10_864_000 as u64) - } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_586_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_138 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(10_536_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } + // Storage: System LastRuntimeUpgrade (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn service_task_named() -> Weight { - Weight::from_ref_time(13_127_000 as u64) + Weight::from_ref_time(12_018_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: System LastRuntimeUpgrade (r:1 w:0) fn service_task_periodic() -> Weight { - Weight::from_ref_time(11_053_000 as u64) + Weight::from_ref_time(10_669_000 as u64) + .saturating_add(T::DbWeight::get().reads(1 as u64)) } + // Storage: System Account (r:1 w:1) + // Storage: System AllExtrinsicsLen (r:1 w:1) + // Storage: System BlockWeight (r:1 w:1) + // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0) + // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_158_000 as u64) + Weight::from_ref_time(36_083_000 as u64) + .saturating_add(T::DbWeight::get().reads(5 as u64)) + .saturating_add(T::DbWeight::get().writes(3 as u64)) } fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_104_000 as u64) + Weight::from_ref_time(4_386_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 511]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(20_074_000 as u64) - // Standard Error: 765 - .saturating_add(Weight::from_ref_time(343_285 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_257_000 as u64) + // Standard Error: 2_791 + .saturating_add(Weight::from_ref_time(574_832 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 512]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(21_509_000 as u64) - // Standard Error: 708 - .saturating_add(Weight::from_ref_time(323_013 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_803_000 as u64) + // Standard Error: 1_177 + .saturating_add(Weight::from_ref_time(475_027 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 511]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_427_000 as u64) - // Standard Error: 850 - .saturating_add(Weight::from_ref_time(357_265 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_746_000 as u64) + // Standard Error: 2_997 + .saturating_add(Weight::from_ref_time(635_697 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 512]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_875_000 as u64) - // Standard Error: 693 - .saturating_add(Weight::from_ref_time(336_643 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_983_000 as u64) + // Standard Error: 1_850 + .saturating_add(Weight::from_ref_time(518_812 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - - // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Lookup (r:1 w:0) // Storage: Scheduler Agenda (r:1 w:1) fn change_named_priority(s: u32, ) -> Weight { - Weight::from_ref_time(8_642_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64)) + Weight::from_ref_time(21_591_000 as u64) + // Standard Error: 4_187 + .saturating_add(Weight::from_ref_time(531_231 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } } @@ -178,93 +145,90 @@ impl WeightInfo for () { // Storage: Scheduler IncompleteSince (r:1 w:1) fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_992_000 as u64) + Weight::from_ref_time(5_253_000 as u64) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 512]`. fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(4_320_000 as u64) - // Standard Error: 619 - .saturating_add(Weight::from_ref_time(336_713 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(3_858_000 as u64) + // Standard Error: 2_617 + .saturating_add(Weight::from_ref_time(579_704 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } + // Storage: System LastRuntimeUpgrade (r:1 w:0) fn service_task_base() -> Weight { - Weight::from_ref_time(10_864_000 as u64) + Weight::from_ref_time(10_536_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_586_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(1_138 as u64).saturating_mul(s as u64)) - .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) - } + // Storage: System LastRuntimeUpgrade (r:1 w:0) // Storage: Scheduler Lookup (r:0 w:1) fn service_task_named() -> Weight { - Weight::from_ref_time(13_127_000 as u64) + Weight::from_ref_time(12_018_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } + // Storage: System LastRuntimeUpgrade (r:1 w:0) fn service_task_periodic() -> Weight { - Weight::from_ref_time(11_053_000 as u64) + Weight::from_ref_time(10_669_000 as u64) + .saturating_add(RocksDbWeight::get().reads(1 as u64)) } + // Storage: System Account (r:1 w:1) + // Storage: System AllExtrinsicsLen (r:1 w:1) + // Storage: System BlockWeight (r:1 w:1) + // Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0) + // Storage: TransactionPayment NextFeeMultiplier (r:1 w:0) fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_158_000 as u64) + Weight::from_ref_time(36_083_000 as u64) + .saturating_add(RocksDbWeight::get().reads(5 as u64)) + .saturating_add(RocksDbWeight::get().writes(3 as u64)) } fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_104_000 as u64) + Weight::from_ref_time(4_386_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 511]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(20_074_000 as u64) - // Standard Error: 765 - .saturating_add(Weight::from_ref_time(343_285 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_257_000 as u64) + // Standard Error: 2_791 + .saturating_add(Weight::from_ref_time(574_832 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 512]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(21_509_000 as u64) - // Standard Error: 708 - .saturating_add(Weight::from_ref_time(323_013 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_803_000 as u64) + // Standard Error: 1_177 + .saturating_add(Weight::from_ref_time(475_027 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(1 as u64)) .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 511]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_427_000 as u64) - // Standard Error: 850 - .saturating_add(Weight::from_ref_time(357_265 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_746_000 as u64) + // Standard Error: 2_997 + .saturating_add(Weight::from_ref_time(635_697 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 512]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_875_000 as u64) - // Standard Error: 693 - .saturating_add(Weight::from_ref_time(336_643 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_983_000 as u64) + // Standard Error: 1_850 + .saturating_add(Weight::from_ref_time(518_812 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(2 as u64)) .saturating_add(RocksDbWeight::get().writes(2 as u64)) } - - // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Lookup (r:1 w:0) // Storage: Scheduler Agenda (r:1 w:1) fn change_named_priority(s: u32, ) -> Weight { - Weight::from_ref_time(8_642_000) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64)) + Weight::from_ref_time(21_591_000 as u64) + // Standard Error: 4_187 + .saturating_add(Weight::from_ref_time(531_231 as u64).saturating_mul(s as u64)) .saturating_add(RocksDbWeight::get().reads(2 as u64)) - .saturating_add(RocksDbWeight::get().writes(2 as u64)) + .saturating_add(RocksDbWeight::get().writes(1 as u64)) } } -- gitstuff