common_runtime/weights/
pallet_message_queue.rs

1//! Autogenerated weights for pallet_message_queue
2//!
3//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 49.1.0
4//! DATE: 2025-08-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5//! WORST CASE MAP SIZE: `1000000`
6//! HOSTNAME: `ip-10-173-5-194`, CPU: `Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz`
7//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
8
9// Executed Command:
10// ./scripts/../target/release/frequency
11// benchmark
12// pallet
13// --pallet=pallet_message_queue
14// --extrinsic
15// *
16// --heap-pages=4096
17// --steps=50
18// --repeat=20
19// --output=./scripts/../runtime/common/src/weights
20// --template=./scripts/../.maintain/runtime-weight-template.hbs
21// --additional-trie-layers=3
22// --runtime=./scripts/../target/release/wbuild/frequency-runtime/frequency_runtime.wasm
23// --genesis-builder=runtime
24
25#![cfg_attr(rustfmt, rustfmt_skip)]
26#![allow(unused_parens)]
27#![allow(unused_imports)]
28#![allow(missing_docs)]
29
30use frame_support::{traits::Get, weights::Weight};
31use core::marker::PhantomData;
32
33/// Weights for `pallet_message_queue` using the Substrate node and recommended hardware.
34pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> pallet_message_queue::WeightInfo for SubstrateWeight<T> {
36	/// Storage: `MessageQueue::ServiceHead` (r:1 w:0)
37	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
38	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
39	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
40	fn ready_ring_knit() -> Weight {
41		// Proof Size summary in bytes:
42		//  Measured:  `223`
43		//  Estimated: `6539`
44		// Minimum execution time: 15_151_000 picoseconds.
45		Weight::from_parts(15_619_000, 6539)
46			.saturating_add(T::DbWeight::get().reads(3_u64))
47			.saturating_add(T::DbWeight::get().writes(2_u64))
48	}
49	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
50	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
51	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
52	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
53	fn ready_ring_unknit() -> Weight {
54		// Proof Size summary in bytes:
55		//  Measured:  `218`
56		//  Estimated: `6539`
57		// Minimum execution time: 14_306_000 picoseconds.
58		Weight::from_parts(14_877_000, 6539)
59			.saturating_add(T::DbWeight::get().reads(3_u64))
60			.saturating_add(T::DbWeight::get().writes(3_u64))
61	}
62	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
63	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
64	fn service_queue_base() -> Weight {
65		// Proof Size summary in bytes:
66		//  Measured:  `6`
67		//  Estimated: `4012`
68		// Minimum execution time: 4_158_000 picoseconds.
69		Weight::from_parts(4_492_000, 4012)
70			.saturating_add(T::DbWeight::get().reads(1_u64))
71			.saturating_add(T::DbWeight::get().writes(1_u64))
72	}
73	/// Storage: `MessageQueue::Pages` (r:1 w:1)
74	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
75	fn service_page_base_completion() -> Weight {
76		// Proof Size summary in bytes:
77		//  Measured:  `72`
78		//  Estimated: `109481`
79		// Minimum execution time: 6_113_000 picoseconds.
80		Weight::from_parts(6_471_000, 109481)
81			.saturating_add(T::DbWeight::get().reads(1_u64))
82			.saturating_add(T::DbWeight::get().writes(1_u64))
83	}
84	/// Storage: `MessageQueue::Pages` (r:1 w:1)
85	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
86	fn service_page_base_no_completion() -> Weight {
87		// Proof Size summary in bytes:
88		//  Measured:  `72`
89		//  Estimated: `109481`
90		// Minimum execution time: 6_416_000 picoseconds.
91		Weight::from_parts(6_891_000, 109481)
92			.saturating_add(T::DbWeight::get().reads(1_u64))
93			.saturating_add(T::DbWeight::get().writes(1_u64))
94	}
95	/// Storage: `MessageQueue::BookStateFor` (r:0 w:1)
96	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
97	/// Storage: `MessageQueue::Pages` (r:0 w:1)
98	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
99	fn service_page_item() -> Weight {
100		// Proof Size summary in bytes:
101		//  Measured:  `0`
102		//  Estimated: `0`
103		// Minimum execution time: 267_987_000 picoseconds.
104		Weight::from_parts(276_186_000, 0)
105			.saturating_add(T::DbWeight::get().writes(2_u64))
106	}
107	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
108	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
109	/// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
110	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
111	fn bump_service_head() -> Weight {
112		// Proof Size summary in bytes:
113		//  Measured:  `171`
114		//  Estimated: `4012`
115		// Minimum execution time: 9_550_000 picoseconds.
116		Weight::from_parts(10_201_000, 4012)
117			.saturating_add(T::DbWeight::get().reads(2_u64))
118			.saturating_add(T::DbWeight::get().writes(1_u64))
119	}
120	/// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
121	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
122	/// Storage: `MessageQueue::ServiceHead` (r:0 w:1)
123	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(5), added: 500, mode: `MaxEncodedLen`)
124	fn set_service_head() -> Weight {
125		// Proof Size summary in bytes:
126		//  Measured:  `161`
127		//  Estimated: `4012`
128		// Minimum execution time: 6_109_000 picoseconds.
129		Weight::from_parts(6_507_000, 4012)
130			.saturating_add(T::DbWeight::get().reads(1_u64))
131			.saturating_add(T::DbWeight::get().writes(1_u64))
132	}
133	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
134	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
135	/// Storage: `MessageQueue::Pages` (r:1 w:1)
136	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
137	fn reap_page() -> Weight {
138		// Proof Size summary in bytes:
139		//  Measured:  `105609`
140		//  Estimated: `109481`
141		// Minimum execution time: 97_323_000 picoseconds.
142		Weight::from_parts(102_865_000, 109481)
143			.saturating_add(T::DbWeight::get().reads(2_u64))
144			.saturating_add(T::DbWeight::get().writes(2_u64))
145	}
146	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
147	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
148	/// Storage: `MessageQueue::Pages` (r:1 w:1)
149	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
150	fn execute_overweight_page_removed() -> Weight {
151		// Proof Size summary in bytes:
152		//  Measured:  `105609`
153		//  Estimated: `109481`
154		// Minimum execution time: 120_568_000 picoseconds.
155		Weight::from_parts(128_164_000, 109481)
156			.saturating_add(T::DbWeight::get().reads(2_u64))
157			.saturating_add(T::DbWeight::get().writes(2_u64))
158	}
159	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
160	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
161	/// Storage: `MessageQueue::Pages` (r:1 w:1)
162	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(105521), added: 107996, mode: `MaxEncodedLen`)
163	fn execute_overweight_page_updated() -> Weight {
164		// Proof Size summary in bytes:
165		//  Measured:  `105609`
166		//  Estimated: `109481`
167		// Minimum execution time: 183_742_000 picoseconds.
168		Weight::from_parts(189_475_000, 109481)
169			.saturating_add(T::DbWeight::get().reads(2_u64))
170			.saturating_add(T::DbWeight::get().writes(2_u64))
171	}
172}
173
174
175#[cfg(test)]
176mod tests {
177  use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
178  use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
179  use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
180
181  #[allow(dead_code)]
182  struct BlockWeights;
183  impl Get<frame_system::limits::BlockWeights> for BlockWeights {
184  	fn get() -> frame_system::limits::BlockWeights {
185  		frame_system::limits::BlockWeights::builder()
186  			.base_block(Weight::zero())
187  			.for_class(DispatchClass::all(), |weights| {
188  				weights.base_extrinsic = ExtrinsicBaseWeight::get();
189  			})
190  			.for_class(DispatchClass::non_mandatory(), |weights| {
191  				weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
192  			})
193  			.build_or_panic()
194  	}
195  }
196
197	#[test]
198	fn test_ready_ring_knit() {
199		assert!(
200			BlockWeights::get()
201				.per_class
202				.get(frame_support::dispatch::DispatchClass::Normal)
203				.max_extrinsic
204				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
205				.proof_size()
206				> 6539
207		);
208	}
209	#[test]
210	fn test_ready_ring_unknit() {
211		assert!(
212			BlockWeights::get()
213				.per_class
214				.get(frame_support::dispatch::DispatchClass::Normal)
215				.max_extrinsic
216				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
217				.proof_size()
218				> 6539
219		);
220	}
221	#[test]
222	fn test_service_queue_base() {
223		assert!(
224			BlockWeights::get()
225				.per_class
226				.get(frame_support::dispatch::DispatchClass::Normal)
227				.max_extrinsic
228				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
229				.proof_size()
230				> 4012
231		);
232	}
233	#[test]
234	fn test_service_page_base_completion() {
235		assert!(
236			BlockWeights::get()
237				.per_class
238				.get(frame_support::dispatch::DispatchClass::Normal)
239				.max_extrinsic
240				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
241				.proof_size()
242				> 109481
243		);
244	}
245	#[test]
246	fn test_service_page_base_no_completion() {
247		assert!(
248			BlockWeights::get()
249				.per_class
250				.get(frame_support::dispatch::DispatchClass::Normal)
251				.max_extrinsic
252				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
253				.proof_size()
254				> 109481
255		);
256	}
257	#[test]
258	fn test_bump_service_head() {
259		assert!(
260			BlockWeights::get()
261				.per_class
262				.get(frame_support::dispatch::DispatchClass::Normal)
263				.max_extrinsic
264				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
265				.proof_size()
266				> 4012
267		);
268	}
269	#[test]
270	fn test_set_service_head() {
271		assert!(
272			BlockWeights::get()
273				.per_class
274				.get(frame_support::dispatch::DispatchClass::Normal)
275				.max_extrinsic
276				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
277				.proof_size()
278				> 4012
279		);
280	}
281	#[test]
282	fn test_reap_page() {
283		assert!(
284			BlockWeights::get()
285				.per_class
286				.get(frame_support::dispatch::DispatchClass::Normal)
287				.max_extrinsic
288				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
289				.proof_size()
290				> 109481
291		);
292	}
293	#[test]
294	fn test_execute_overweight_page_removed() {
295		assert!(
296			BlockWeights::get()
297				.per_class
298				.get(frame_support::dispatch::DispatchClass::Normal)
299				.max_extrinsic
300				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
301				.proof_size()
302				> 109481
303		);
304	}
305	#[test]
306	fn test_execute_overweight_page_updated() {
307		assert!(
308			BlockWeights::get()
309				.per_class
310				.get(frame_support::dispatch::DispatchClass::Normal)
311				.max_extrinsic
312				.unwrap_or_else(<Weight as sp_runtime::traits::Bounded>::max_value)
313				.proof_size()
314				> 109481
315		);
316	}
317}