git.delta.rocks / unique-network / refs/commits / 28ac5b8847c0

difftreelog

Benchmark completed

Dev2022-06-09parent: #1ec9cce.patch.diff
in: master

8 files changed

modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,14 @@
 	--template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
 	--output=./pallets/$(PALLET)/src/weights.rs
 
+.PHONY: _bench2
+_bench2:
+	cargo run --release --features runtime-benchmarks,unique-runtime -- \
+	benchmark pallet --pallet pallet-$(PALLET) \
+	--wasm-execution compiled --extrinsic '*' \
+	--template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
+	--output=./pallets/$(PALLET_DIR)/src/weights.rs
+
 .PHONY: bench-evm-migration
 bench-evm-migration:
 	make _bench PALLET=evm-migration
@@ -95,7 +103,7 @@
 
 .PHONY: bench-scheduler
 bench-scheduler:
-	make _bench PALLET=unq-scheduler	
+	make _bench2 PALLET=unq-scheduler PALLET_DIR=scheduler
 
 .PHONY: bench
 bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler
modifiedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth
35//! Scheduler pallet benchmarking.35//! Scheduler pallet benchmarking.
3636
37use super::*;37use super::*;
38use frame_benchmarking::benchmarks;38use frame_benchmarking::{benchmarks, account};
39use frame_support::{39use frame_support::{
40 ensure,40 ensure,
41 traits::{OnInitialize, PreimageProvider, PreimageRecipient},41 traits::{OnInitialize},
42};42};
43use frame_system::RawOrigin;43use frame_system::RawOrigin;
44use sp_runtime::traits::Hash;44use sp_runtime::traits::Hash;
45use sp_std::{prelude::*, vec};45use sp_std::{prelude::*, vec};
4646
47use crate::Pallet as Scheduler;47use crate::Pallet as Scheduler;
48use frame_system::Pallet as System;48use frame_system::Pallet as System;
49use frame_support::traits::Currency;
4950
50const BLOCK_NUMBER: u32 = 2;51const BLOCK_NUMBER: u32 = 2;
5152
59 when: T::BlockNumber,60 when: T::BlockNumber,
60 n: u32,61 n: u32,
61 periodic: bool,62 periodic: bool,
62 named: bool,
63 resolved: Option<bool>,63 resolved: Option<bool>,
64) -> Result<(), &'static str> {64) -> Result<(), &'static str> {
65
66 let t = DispatchTime::At(when);
67 let caller = account("user", 0, 1);
68
69 // Give the sender account max funds for transfer (their account will never reasonably be killed).
70 T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
71
65 for i in 0..n {72 for i in 0..n {
66 // Named schedule is strictly heavier than anonymous
67 let (call, hash) = call_and_hash::<T>(i);73 let (call, hash) = call_and_hash::<T>(i);
68 let call_or_hash = match resolved {74 let call_or_hash = match resolved {
69 Some(true) => {
70 T::PreimageProvider::note_preimage(call.encode().try_into().unwrap());
71 if T::PreimageProvider::have_preimage(&hash) {
72 CallOrHashOf::<T>::Hash(hash)
73 } else {
74 call.into()
75 }
76 }
77 Some(false) => call.into(),75 Some(_) => call.into(),
78 None => CallOrHashOf::<T>::Hash(hash),76 None => CallOrHashOf::<T>::Hash(hash),
79 };77 };
80 let period = match periodic {78 let period = match periodic {
81 true => Some(((i + 100).into(), 100)),79 true => Some(((i + 100).into(), 100)),
82 false => None,80 false => None,
83 };81 };
82
84 let t = DispatchTime::At(when);83 let slice_id: [u8; 4] = i.encode().try_into().unwrap();
84 let mut id: [u8; 16] = [0; 16];
85 id[..4].clone_from_slice(&slice_id);
86
85 let origin = frame_system::RawOrigin::Root.into();87 let origin = frame_system::RawOrigin::Signed(caller.clone()).into();
86 if named {
87 Scheduler::<T>::do_schedule_named(88 Scheduler::<T>::do_schedule_named(
88 i.encode()
89 .try_into()
90 .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]),89 id,
91 t,90 t,
92 period,91 period,
93 0,92 0,
94 origin,93 origin,
95 call_or_hash,94 call_or_hash,
96 )?;95 )?;
97 } else {
98 Scheduler::<T>::do_schedule(t, period, 0, origin, call_or_hash)?;
99 }
100 }96 }
101 ensure!(97 ensure!(
102 Agenda::<T>::get(when).len() == n as usize,98 Agenda::<T>::get(when).len() == n as usize,
116 on_initialize_periodic_named_resolved {112 on_initialize_periodic_named_resolved {
117 let s in 1 .. T::MaxScheduledPerBlock::get();113 let s in 1 .. T::MaxScheduledPerBlock::get();
118 let when = BLOCK_NUMBER.into();114 let when = BLOCK_NUMBER.into();
119 fill_schedule::<T>(when, s, true, true, Some(true))?;115 fill_schedule::<T>(when, s, true, Some(true))?;
120 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }116 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
121 verify {117 verify {
122 assert_eq!(System::<T>::event_count(), s * 2);118 assert_eq!(System::<T>::event_count(), s);
123 for i in 0..s {119 for i in 0..s {
124 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);120 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
125 }121 }
128 on_initialize_named_resolved {124 on_initialize_named_resolved {
129 let s in 1 .. T::MaxScheduledPerBlock::get();125 let s in 1 .. T::MaxScheduledPerBlock::get();
130 let when = BLOCK_NUMBER.into();126 let when = BLOCK_NUMBER.into();
131 fill_schedule::<T>(when, s, false, true, Some(true))?;127 fill_schedule::<T>(when, s, false, Some(true))?;
132 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }128 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
133 verify {129 verify {
134 assert_eq!(System::<T>::event_count(), s * 2);130 assert_eq!(System::<T>::event_count(), s);
135 assert!(Agenda::<T>::iter().count() == 0);131 assert!(Agenda::<T>::iter().count() == 0);
136 }132 }
137133
138 on_initialize_periodic_resolved {134 on_initialize_periodic_resolved {
139 let s in 1 .. T::MaxScheduledPerBlock::get();135 let s in 1 .. T::MaxScheduledPerBlock::get();
140 let when = BLOCK_NUMBER.into();136 let when = BLOCK_NUMBER.into();
141 fill_schedule::<T>(when, s, true, false, Some(true))?;137 fill_schedule::<T>(when, s, true, Some(true))?;
142 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }138 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
143 verify {139 verify {
144 assert_eq!(System::<T>::event_count(), s * 2);140 assert_eq!(System::<T>::event_count(), s );
145 for i in 0..s {141 for i in 0..s {
146 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);142 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
147 }143 }
150 on_initialize_resolved {146 on_initialize_resolved {
151 let s in 1 .. T::MaxScheduledPerBlock::get();147 let s in 1 .. T::MaxScheduledPerBlock::get();
152 let when = BLOCK_NUMBER.into();148 let when = BLOCK_NUMBER.into();
153 fill_schedule::<T>(when, s, false, false, Some(true))?;149 fill_schedule::<T>(when, s, false, Some(true))?;
154 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }150 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
155 verify {
156 assert_eq!(System::<T>::event_count(), s * 2);
157 assert!(Agenda::<T>::iter().count() == 0);
158 }
159
160 on_initialize_named_aborted {
161 let s in 1 .. T::MaxScheduledPerBlock::get();
162 let when = BLOCK_NUMBER.into();
163 fill_schedule::<T>(when, s, false, true, None)?;
164 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
165 verify {
166 assert_eq!(System::<T>::event_count(), 0);
167 if let Some(delay) = T::NoPreimagePostponement::get() {
168 assert_eq!(Agenda::<T>::get(when + delay).len(), s as usize);
169 } else {
170 assert!(Agenda::<T>::iter().count() == 0);
171 }
172 }
173
174 on_initialize_aborted {
175 let s in 1 .. T::MaxScheduledPerBlock::get();
176 let when = BLOCK_NUMBER.into();
177 fill_schedule::<T>(when, s, false, false, None)?;
178 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
179 verify {
180 assert_eq!(System::<T>::event_count(), 0);
181 if let Some(delay) = T::NoPreimagePostponement::get() {
182 assert_eq!(Agenda::<T>::get(when + delay).len(), s as usize);
183 } else {
184 assert!(Agenda::<T>::iter().count() == 0);
185 }
186 }
187
188 on_initialize_periodic_named {
189 let s in 1 .. T::MaxScheduledPerBlock::get();
190 let when = BLOCK_NUMBER.into();
191 fill_schedule::<T>(when, s, true, true, Some(false))?;
192 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
193 verify {
194 assert_eq!(System::<T>::event_count(), s);
195 for i in 0..s {
196 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
197 }
198 }
199
200 on_initialize_periodic {
201 let s in 1 .. T::MaxScheduledPerBlock::get();
202 let when = BLOCK_NUMBER.into();
203 fill_schedule::<T>(when, s, true, false, Some(false))?;
204 }: { Scheduler::<T>::on_initialize(when); }
205 verify {
206 assert_eq!(System::<T>::event_count(), s);
207 for i in 0..s {
208 assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
209 }
210 }
211
212 on_initialize_named {
213 let s in 1 .. T::MaxScheduledPerBlock::get();
214 let when = BLOCK_NUMBER.into();
215 fill_schedule::<T>(when, s, false, true, Some(false))?;
216 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
217 verify {151 verify {
218 assert_eq!(System::<T>::event_count(), s);152 assert_eq!(System::<T>::event_count(), s);
219 assert!(Agenda::<T>::iter().count() == 0);153 assert!(Agenda::<T>::iter().count() == 0);
220 }154 }
221155
222 on_initialize {156 schedule_named {
223 let s in 1 .. T::MaxScheduledPerBlock::get();157 let caller: T::AccountId = account("user", 0, 1);
224 let when = BLOCK_NUMBER.into();
225 fill_schedule::<T>(when, s, false, false, Some(false))?;
226 }: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }158 let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
227 verify {
228 assert_eq!(System::<T>::event_count(), s);
229 assert!(Agenda::<T>::iter().count() == 0);
230 }
231
232 schedule_named {
233 let s in 0 .. T::MaxScheduledPerBlock::get();159 let s in 0 .. T::MaxScheduledPerBlock::get();
234 let id = s.encode().try_into().unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);160 let slice_id: [u8; 4] = s.encode().try_into().unwrap();
161 let mut id: [u8; 16] = [0; 16];
162 id[..4].clone_from_slice(&slice_id);
235 let when = BLOCK_NUMBER.into();163 let when = BLOCK_NUMBER.into();
236 let periodic = Some((T::BlockNumber::one(), 100));164 let periodic = Some((T::BlockNumber::one(), 100));
237 let priority = 0;165 let priority = 0;
238 // Essentially a no-op call.166 // Essentially a no-op call.
239 let inner_call = frame_system::Call::set_storage { items: vec![] }.into();167 let inner_call = frame_system::Call::set_storage { items: vec![] }.into();
240 let call = Box::new(CallOrHashOf::<T>::Value(inner_call));168 let call = Box::new(CallOrHashOf::<T>::Value(inner_call));
241
242 fill_schedule::<T>(when, s, true, true, Some(false))?;169 fill_schedule::<T>(when, s, true, Some(false))?;
243 }: _(RawOrigin::Root, id, when, periodic, priority, call)170 }: _(origin, id, when, periodic, priority, call)
244 verify {171 verify {
245 ensure!(172 ensure!(
246 Agenda::<T>::get(when).len() == (s + 1) as usize,173 Agenda::<T>::get(when).len() == (s + 1) as usize,
249 }176 }
250177
251 cancel_named {178 cancel_named {
179 let caller: T::AccountId = account("user", 0, 1);
180 let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
252 let s in 1 .. T::MaxScheduledPerBlock::get();181 let s in 1 .. T::MaxScheduledPerBlock::get();
253 let when = BLOCK_NUMBER.into();182 let when = BLOCK_NUMBER.into();
254 let id = 0.encode().try_into().unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);183 let id = 0.encode().try_into().unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
255
256 fill_schedule::<T>(when, s, true, true, Some(false))?;184 fill_schedule::<T>(when, s, true, Some(false))?;
257 }: _(RawOrigin::Root, id)185 }: _(origin, id)
258 verify {186 verify {
259 ensure!(187 ensure!(
260 Lookup::<T>::get(id).is_none(),188 Lookup::<T>::get(id).is_none(),
modifiedpallets/scheduler/src/weights.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/weights.rs
+++ b/pallets/scheduler/src/weights.rs
@@ -1,213 +1,118 @@
-// 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_unq_scheduler
 //!
 //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
+//! DATE: 2022-06-09, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
 
 // Executed Command:
-// ./target/production/substrate
+// target/release/unique-collator
 // benchmark
-// --chain=dev
+// pallet
+// --pallet
+// pallet-unq-scheduler
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
 // --steps=50
-// --repeat=20
-// --pallet=pallet_scheduler
-// --extrinsic=*
-// --execution=wasm
-// --wasm-execution=compiled
+// --repeat=200
 // --heap-pages=4096
-// --output=./frame/scheduler/src/weights.rs
-// --template=.maintain/frame-weight-template.hbs
-// --header=HEADER-APACHE2
-// --raw
+// --output=./pallets/scheduler/src/weights.rs
 
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![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_unq_scheduler.
 pub trait WeightInfo {
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;
 	fn on_initialize_named_resolved(s: u32, ) -> Weight;
 	fn on_initialize_periodic_resolved(s: u32, ) -> Weight;
 	fn on_initialize_resolved(s: u32, ) -> Weight;
-	fn on_initialize_named_aborted(s: u32, ) -> Weight;
-	fn on_initialize_aborted(s: u32, ) -> Weight;
-	fn on_initialize_periodic_named(s: u32, ) -> Weight;
-	fn on_initialize_periodic(s: u32, ) -> Weight;
-	fn on_initialize_named(s: u32, ) -> Weight;
-	fn on_initialize(s: u32, ) -> Weight;
-	fn schedule(s: u32, ) -> Weight;
-	fn cancel(s: u32, ) -> Weight;
 	fn schedule_named(s: u32, ) -> Weight;
 	fn cancel_named(s: u32, ) -> Weight;
 }
 
-/// Weights for pallet_scheduler using the Substrate node and recommended hardware.
+/// Weights for pallet_unq_scheduler using the Substrate node and recommended hardware.
 pub struct SubstrateWeight<T>(PhantomData<T>);
 impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		(11_587_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
+		(39_822_000 as Weight)
+			// Standard Error: 4_000
+			.saturating_add((31_823_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		(8_965_000 as Weight)
-			// Standard Error: 11_000
-			.saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		(8_654_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		(9_303_000 as Weight)
-			// Standard Error: 10_000
-			.saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		(7_506_000 as Weight)
+		(36_019_000 as Weight)
 			// Standard Error: 3_000
-			.saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(2 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
+			.saturating_add((22_660_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
 			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
-	fn on_initialize_aborted(s: u32, ) -> Weight {
-		(8_046_000 as Weight)
-			// Standard Error: 3_000
-			.saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(2 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_periodic_named(s: u32, ) -> Weight {
-		(13_704_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
+	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
+		(36_613_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((31_895_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
 			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
 			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		(12_668_000 as Weight)
-			// Standard Error: 5_000
-			.saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named(s: u32, ) -> Weight {
-		(13_946_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+	fn on_initialize_resolved(s: u32, ) -> Weight {
+		(36_252_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((22_662_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
 			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn on_initialize(s: u32, ) -> Weight {
-		(13_151_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
 	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule(s: u32, ) -> Weight {
-		(14_040_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((89_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn cancel(s: u32, ) -> Weight {
-		(14_376_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((576_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn schedule_named(s: u32, ) -> Weight {
-		(16_806_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((102_000 as Weight).saturating_mul(s as Weight))
+		(34_561_000 as Weight)
+			// Standard Error: 0
+			.saturating_add((161_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(T::DbWeight::get().reads(2 as Weight))
 			.saturating_add(T::DbWeight::get().writes(2 as Weight))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn cancel_named(s: u32, ) -> Weight {
-		(15_852_000 as Weight)
-			// Standard Error: 2_000
-			.saturating_add((590_000 as Weight).saturating_mul(s as Weight))
+		(30_932_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((1_537_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(T::DbWeight::get().reads(2 as Weight))
 			.saturating_add(T::DbWeight::get().writes(2 as Weight))
 	}
@@ -216,148 +121,74 @@
 // For backwards compatibility and tests
 impl WeightInfo for () {
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		(11_587_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
+		(39_822_000 as Weight)
+			// Standard Error: 4_000
+			.saturating_add((31_823_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		(8_965_000 as Weight)
-			// Standard Error: 11_000
-			.saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		(8_654_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		(9_303_000 as Weight)
-			// Standard Error: 10_000
-			.saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		(7_506_000 as Weight)
+		(36_019_000 as Weight)
 			// Standard Error: 3_000
-			.saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
+			.saturating_add((22_660_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
-	fn on_initialize_aborted(s: u32, ) -> Weight {
-		(8_046_000 as Weight)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
+	// Storage: Scheduler Lookup (r:0 w:1)
+	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
+		(36_613_000 as Weight)
 			// Standard Error: 3_000
-			.saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add((31_895_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
 			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_periodic_named(s: u32, ) -> Weight {
-		(13_704_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		(12_668_000 as Weight)
-			// Standard Error: 5_000
-			.saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
-	}
 	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named(s: u32, ) -> Weight {
-		(13_946_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+	fn on_initialize_resolved(s: u32, ) -> Weight {
+		(36_252_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((22_662_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn on_initialize(s: u32, ) -> Weight {
-		(13_151_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule(s: u32, ) -> Weight {
-		(14_040_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((89_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn cancel(s: u32, ) -> Weight {
-		(14_376_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((576_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn schedule_named(s: u32, ) -> Weight {
-		(16_806_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((102_000 as Weight).saturating_mul(s as Weight))
+		(34_561_000 as Weight)
+			// Standard Error: 0
+			.saturating_add((161_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
 			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn cancel_named(s: u32, ) -> Weight {
-		(15_852_000 as Weight)
-			// Standard Error: 2_000
-			.saturating_add((590_000 as Weight).saturating_mul(s as Weight))
+		(30_932_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((1_537_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
 			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 	}
modifiedruntime/common/Cargo.tomldiffbeforeafterboth
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -89,6 +89,10 @@
 default-features = false
 path = "../../pallets/refungible"
 
+[dependencies.pallet-unq-scheduler]
+default-features = false
+path = "../../pallets/scheduler"
+
 [dependencies.up-data-structs]
 default-features = false
 path = "../../primitives/data-structs"
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -774,6 +774,7 @@
                     list_benchmark!(list, extra, pallet_fungible, Fungible);
                     list_benchmark!(list, extra, pallet_refungible, Refungible);
                     list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
+                    list_benchmark!(list, extra, pallet_unq_scheduler, Scheduler);
                     // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
 
                     let storage_info = AllPalletsReversedWithSystemFirst::storage_info();
@@ -817,6 +818,8 @@
                     add_benchmark!(params, batches, pallet_fungible, Fungible);
                     add_benchmark!(params, batches, pallet_refungible, Refungible);
                     add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
+                    add_benchmark!(params, batches, pallet_unq_scheduler, Scheduler);
+
                     // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
 
                     if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -36,6 +36,7 @@
     'pallet-proxy-rmrk-core/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unq-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -36,6 +36,7 @@
     'pallet-proxy-rmrk-core/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unq-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -36,6 +36,7 @@
     'pallet-proxy-rmrk-core/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unq-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',