pallet_message_queue/weights.rs
1// This file is part of Substrate.
2
3// Copyright (C) Parity Technologies (UK) Ltd.
4// SPDX-License-Identifier: Apache-2.0
5
6// Licensed under the Apache License, Version 2.0 (the "License");
7// you may not use this file except in compliance with the License.
8// You may obtain a copy of the License at
9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17
18// This file is part of Substrate.
19
20// Copyright (C) Parity Technologies (UK) Ltd.
21// SPDX-License-Identifier: Apache-2.0
22
23// Licensed under the Apache License, Version 2.0 (the "License");
24// you may not use this file except in compliance with the License.
25// You may obtain a copy of the License at
26//
27// http://www.apache.org/licenses/LICENSE-2.0
28//
29// Unless required by applicable law or agreed to in writing, software
30// distributed under the License is distributed on an "AS IS" BASIS,
31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32// See the License for the specific language governing permissions and
33// limitations under the License.
34
35//! Autogenerated weights for `pallet_message_queue`
36//!
37//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
38//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
39//! WORST CASE MAP SIZE: `1000000`
40//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
41//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
42
43// Executed Command:
44// frame-omni-bencher
45// v1
46// benchmark
47// pallet
48// --extrinsic=*
49// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
50// --pallet=pallet_message_queue
51// --header=/__w/polkadot-sdk/polkadot-sdk/substrate/HEADER-APACHE2
52// --output=/__w/polkadot-sdk/polkadot-sdk/substrate/frame/message-queue/src/weights.rs
53// --wasm-execution=compiled
54// --steps=50
55// --repeat=20
56// --heap-pages=4096
57// --template=substrate/.maintain/frame-weight-template.hbs
58// --no-storage-info
59// --no-min-squares
60// --no-median-slopes
61// --genesis-builder-policy=none
62// --exclude-pallets=pallet_xcm,pallet_xcm_benchmarks::fungible,pallet_xcm_benchmarks::generic,pallet_nomination_pools,pallet_remark,pallet_transaction_storage,pallet_election_provider_multi_block,pallet_election_provider_multi_block::signed,pallet_election_provider_multi_block::unsigned,pallet_election_provider_multi_block::verifier
63
64#![cfg_attr(rustfmt, rustfmt_skip)]
65#![allow(unused_parens)]
66#![allow(unused_imports)]
67#![allow(missing_docs)]
68#![allow(dead_code)]
69
70use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
71use core::marker::PhantomData;
72
73/// Weight functions needed for `pallet_message_queue`.
74pub trait WeightInfo {
75 fn ready_ring_knit() -> Weight;
76 fn ready_ring_unknit() -> Weight;
77 fn service_queue_base() -> Weight;
78 fn service_page_base_completion() -> Weight;
79 fn service_page_base_no_completion() -> Weight;
80 fn service_page_item() -> Weight;
81 fn bump_service_head() -> Weight;
82 fn set_service_head() -> Weight;
83 fn reap_page() -> Weight;
84 fn execute_overweight_page_removed() -> Weight;
85 fn execute_overweight_page_updated() -> Weight;
86}
87
88/// Weights for `pallet_message_queue` using the Substrate node and recommended hardware.
89pub struct SubstrateWeight<T>(PhantomData<T>);
90impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
91 /// Storage: `MessageQueue::ServiceHead` (r:1 w:0)
92 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
93 /// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
94 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
95 fn ready_ring_knit() -> Weight {
96 // Proof Size summary in bytes:
97 // Measured: `209`
98 // Estimated: `6038`
99 // Minimum execution time: 12_258_000 picoseconds.
100 Weight::from_parts(12_505_000, 6038)
101 .saturating_add(T::DbWeight::get().reads(3_u64))
102 .saturating_add(T::DbWeight::get().writes(2_u64))
103 }
104 /// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
105 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
106 /// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
107 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
108 fn ready_ring_unknit() -> Weight {
109 // Proof Size summary in bytes:
110 // Measured: `209`
111 // Estimated: `6038`
112 // Minimum execution time: 11_102_000 picoseconds.
113 Weight::from_parts(11_403_000, 6038)
114 .saturating_add(T::DbWeight::get().reads(3_u64))
115 .saturating_add(T::DbWeight::get().writes(3_u64))
116 }
117 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
118 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
119 fn service_queue_base() -> Weight {
120 // Proof Size summary in bytes:
121 // Measured: `0`
122 // Estimated: `3514`
123 // Minimum execution time: 2_413_000 picoseconds.
124 Weight::from_parts(2_535_000, 3514)
125 .saturating_add(T::DbWeight::get().reads(1_u64))
126 .saturating_add(T::DbWeight::get().writes(1_u64))
127 }
128 /// Storage: `MessageQueue::Pages` (r:1 w:1)
129 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
130 fn service_page_base_completion() -> Weight {
131 // Proof Size summary in bytes:
132 // Measured: `50`
133 // Estimated: `69049`
134 // Minimum execution time: 4_484_000 picoseconds.
135 Weight::from_parts(4_692_000, 69049)
136 .saturating_add(T::DbWeight::get().reads(1_u64))
137 .saturating_add(T::DbWeight::get().writes(1_u64))
138 }
139 /// Storage: `MessageQueue::Pages` (r:1 w:1)
140 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
141 fn service_page_base_no_completion() -> Weight {
142 // Proof Size summary in bytes:
143 // Measured: `50`
144 // Estimated: `69049`
145 // Minimum execution time: 4_546_000 picoseconds.
146 Weight::from_parts(4_713_000, 69049)
147 .saturating_add(T::DbWeight::get().reads(1_u64))
148 .saturating_add(T::DbWeight::get().writes(1_u64))
149 }
150 /// Storage: `MessageQueue::BookStateFor` (r:0 w:1)
151 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
152 /// Storage: `MessageQueue::Pages` (r:0 w:1)
153 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
154 fn service_page_item() -> Weight {
155 // Proof Size summary in bytes:
156 // Measured: `0`
157 // Estimated: `0`
158 // Minimum execution time: 169_004_000 picoseconds.
159 Weight::from_parts(171_711_000, 0)
160 .saturating_add(T::DbWeight::get().writes(2_u64))
161 }
162 /// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
163 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
164 /// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
165 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
166 fn bump_service_head() -> Weight {
167 // Proof Size summary in bytes:
168 // Measured: `154`
169 // Estimated: `3514`
170 // Minimum execution time: 6_878_000 picoseconds.
171 Weight::from_parts(7_040_000, 3514)
172 .saturating_add(T::DbWeight::get().reads(2_u64))
173 .saturating_add(T::DbWeight::get().writes(1_u64))
174 }
175 /// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
176 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
177 /// Storage: `MessageQueue::ServiceHead` (r:0 w:1)
178 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
179 fn set_service_head() -> Weight {
180 // Proof Size summary in bytes:
181 // Measured: `154`
182 // Estimated: `3514`
183 // Minimum execution time: 5_960_000 picoseconds.
184 Weight::from_parts(6_145_000, 3514)
185 .saturating_add(T::DbWeight::get().reads(1_u64))
186 .saturating_add(T::DbWeight::get().writes(1_u64))
187 }
188 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
189 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
190 /// Storage: `MessageQueue::Pages` (r:1 w:1)
191 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
192 fn reap_page() -> Weight {
193 // Proof Size summary in bytes:
194 // Measured: `65652`
195 // Estimated: `69049`
196 // Minimum execution time: 61_149_000 picoseconds.
197 Weight::from_parts(61_831_000, 69049)
198 .saturating_add(T::DbWeight::get().reads(2_u64))
199 .saturating_add(T::DbWeight::get().writes(2_u64))
200 }
201 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
202 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
203 /// Storage: `MessageQueue::Pages` (r:1 w:1)
204 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
205 fn execute_overweight_page_removed() -> Weight {
206 // Proof Size summary in bytes:
207 // Measured: `65652`
208 // Estimated: `69049`
209 // Minimum execution time: 78_851_000 picoseconds.
210 Weight::from_parts(79_899_000, 69049)
211 .saturating_add(T::DbWeight::get().reads(2_u64))
212 .saturating_add(T::DbWeight::get().writes(2_u64))
213 }
214 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
215 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
216 /// Storage: `MessageQueue::Pages` (r:1 w:1)
217 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
218 fn execute_overweight_page_updated() -> Weight {
219 // Proof Size summary in bytes:
220 // Measured: `65652`
221 // Estimated: `69049`
222 // Minimum execution time: 117_359_000 picoseconds.
223 Weight::from_parts(118_679_000, 69049)
224 .saturating_add(T::DbWeight::get().reads(2_u64))
225 .saturating_add(T::DbWeight::get().writes(2_u64))
226 }
227}
228
229// For backwards compatibility and tests.
230impl WeightInfo for () {
231 /// Storage: `MessageQueue::ServiceHead` (r:1 w:0)
232 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
233 /// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
234 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
235 fn ready_ring_knit() -> Weight {
236 // Proof Size summary in bytes:
237 // Measured: `209`
238 // Estimated: `6038`
239 // Minimum execution time: 12_258_000 picoseconds.
240 Weight::from_parts(12_505_000, 6038)
241 .saturating_add(RocksDbWeight::get().reads(3_u64))
242 .saturating_add(RocksDbWeight::get().writes(2_u64))
243 }
244 /// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
245 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
246 /// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
247 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
248 fn ready_ring_unknit() -> Weight {
249 // Proof Size summary in bytes:
250 // Measured: `209`
251 // Estimated: `6038`
252 // Minimum execution time: 11_102_000 picoseconds.
253 Weight::from_parts(11_403_000, 6038)
254 .saturating_add(RocksDbWeight::get().reads(3_u64))
255 .saturating_add(RocksDbWeight::get().writes(3_u64))
256 }
257 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
258 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
259 fn service_queue_base() -> Weight {
260 // Proof Size summary in bytes:
261 // Measured: `0`
262 // Estimated: `3514`
263 // Minimum execution time: 2_413_000 picoseconds.
264 Weight::from_parts(2_535_000, 3514)
265 .saturating_add(RocksDbWeight::get().reads(1_u64))
266 .saturating_add(RocksDbWeight::get().writes(1_u64))
267 }
268 /// Storage: `MessageQueue::Pages` (r:1 w:1)
269 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
270 fn service_page_base_completion() -> Weight {
271 // Proof Size summary in bytes:
272 // Measured: `50`
273 // Estimated: `69049`
274 // Minimum execution time: 4_484_000 picoseconds.
275 Weight::from_parts(4_692_000, 69049)
276 .saturating_add(RocksDbWeight::get().reads(1_u64))
277 .saturating_add(RocksDbWeight::get().writes(1_u64))
278 }
279 /// Storage: `MessageQueue::Pages` (r:1 w:1)
280 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
281 fn service_page_base_no_completion() -> Weight {
282 // Proof Size summary in bytes:
283 // Measured: `50`
284 // Estimated: `69049`
285 // Minimum execution time: 4_546_000 picoseconds.
286 Weight::from_parts(4_713_000, 69049)
287 .saturating_add(RocksDbWeight::get().reads(1_u64))
288 .saturating_add(RocksDbWeight::get().writes(1_u64))
289 }
290 /// Storage: `MessageQueue::BookStateFor` (r:0 w:1)
291 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
292 /// Storage: `MessageQueue::Pages` (r:0 w:1)
293 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
294 fn service_page_item() -> Weight {
295 // Proof Size summary in bytes:
296 // Measured: `0`
297 // Estimated: `0`
298 // Minimum execution time: 169_004_000 picoseconds.
299 Weight::from_parts(171_711_000, 0)
300 .saturating_add(RocksDbWeight::get().writes(2_u64))
301 }
302 /// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
303 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
304 /// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
305 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
306 fn bump_service_head() -> Weight {
307 // Proof Size summary in bytes:
308 // Measured: `154`
309 // Estimated: `3514`
310 // Minimum execution time: 6_878_000 picoseconds.
311 Weight::from_parts(7_040_000, 3514)
312 .saturating_add(RocksDbWeight::get().reads(2_u64))
313 .saturating_add(RocksDbWeight::get().writes(1_u64))
314 }
315 /// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
316 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
317 /// Storage: `MessageQueue::ServiceHead` (r:0 w:1)
318 /// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
319 fn set_service_head() -> Weight {
320 // Proof Size summary in bytes:
321 // Measured: `154`
322 // Estimated: `3514`
323 // Minimum execution time: 5_960_000 picoseconds.
324 Weight::from_parts(6_145_000, 3514)
325 .saturating_add(RocksDbWeight::get().reads(1_u64))
326 .saturating_add(RocksDbWeight::get().writes(1_u64))
327 }
328 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
329 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
330 /// Storage: `MessageQueue::Pages` (r:1 w:1)
331 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
332 fn reap_page() -> Weight {
333 // Proof Size summary in bytes:
334 // Measured: `65652`
335 // Estimated: `69049`
336 // Minimum execution time: 61_149_000 picoseconds.
337 Weight::from_parts(61_831_000, 69049)
338 .saturating_add(RocksDbWeight::get().reads(2_u64))
339 .saturating_add(RocksDbWeight::get().writes(2_u64))
340 }
341 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
342 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
343 /// Storage: `MessageQueue::Pages` (r:1 w:1)
344 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
345 fn execute_overweight_page_removed() -> Weight {
346 // Proof Size summary in bytes:
347 // Measured: `65652`
348 // Estimated: `69049`
349 // Minimum execution time: 78_851_000 picoseconds.
350 Weight::from_parts(79_899_000, 69049)
351 .saturating_add(RocksDbWeight::get().reads(2_u64))
352 .saturating_add(RocksDbWeight::get().writes(2_u64))
353 }
354 /// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
355 /// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
356 /// Storage: `MessageQueue::Pages` (r:1 w:1)
357 /// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
358 fn execute_overweight_page_updated() -> Weight {
359 // Proof Size summary in bytes:
360 // Measured: `65652`
361 // Estimated: `69049`
362 // Minimum execution time: 117_359_000 picoseconds.
363 Weight::from_parts(118_679_000, 69049)
364 .saturating_add(RocksDbWeight::get().reads(2_u64))
365 .saturating_add(RocksDbWeight::get().writes(2_u64))
366 }
367}