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
//! Autogenerated weights for `pallet_message_queue`
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
24
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25

            
26
// Executed Command:
27
// ./target/production/substrate-node
28
// benchmark
29
// pallet
30
// --chain=dev
31
// --steps=50
32
// --repeat=20
33
// --pallet=pallet_message_queue
34
// --no-storage-info
35
// --no-median-slopes
36
// --no-min-squares
37
// --extrinsic=*
38
// --wasm-execution=compiled
39
// --heap-pages=4096
40
// --output=./substrate/frame/message-queue/src/weights.rs
41
// --header=./substrate/HEADER-APACHE2
42
// --template=./substrate/.maintain/frame-weight-template.hbs
43

            
44
#![cfg_attr(rustfmt, rustfmt_skip)]
45
#![allow(unused_parens)]
46
#![allow(unused_imports)]
47
#![allow(missing_docs)]
48

            
49
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50
use core::marker::PhantomData;
51

            
52
/// Weight functions needed for `pallet_message_queue`.
53
pub trait WeightInfo {
54
	fn ready_ring_knit() -> Weight;
55
	fn ready_ring_unknit() -> Weight;
56
	fn service_queue_base() -> Weight;
57
	fn service_page_base_completion() -> Weight;
58
	fn service_page_base_no_completion() -> Weight;
59
	fn service_page_item() -> Weight;
60
	fn bump_service_head() -> Weight;
61
	fn reap_page() -> Weight;
62
	fn execute_overweight_page_removed() -> Weight;
63
	fn execute_overweight_page_updated() -> Weight;
64
}
65

            
66
/// Weights for `pallet_message_queue` using the Substrate node and recommended hardware.
67
pub struct SubstrateWeight<T>(PhantomData<T>);
68
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
69
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:0)
70
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
71
	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
72
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
73
	fn ready_ring_knit() -> Weight {
74
		// Proof Size summary in bytes:
75
		//  Measured:  `301`
76
		//  Estimated: `6038`
77
		// Minimum execution time: 11_674_000 picoseconds.
78
		Weight::from_parts(12_105_000, 6038)
79
			.saturating_add(T::DbWeight::get().reads(3_u64))
80
			.saturating_add(T::DbWeight::get().writes(2_u64))
81
	}
82
	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
83
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
84
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
85
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
86
	fn ready_ring_unknit() -> Weight {
87
		// Proof Size summary in bytes:
88
		//  Measured:  `301`
89
		//  Estimated: `6038`
90
		// Minimum execution time: 10_262_000 picoseconds.
91
		Weight::from_parts(10_654_000, 6038)
92
			.saturating_add(T::DbWeight::get().reads(3_u64))
93
			.saturating_add(T::DbWeight::get().writes(3_u64))
94
	}
95
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
96
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
97
	fn service_queue_base() -> Weight {
98
		// Proof Size summary in bytes:
99
		//  Measured:  `76`
100
		//  Estimated: `3514`
101
		// Minimum execution time: 4_363_000 picoseconds.
102
		Weight::from_parts(4_589_000, 3514)
103
			.saturating_add(T::DbWeight::get().reads(1_u64))
104
			.saturating_add(T::DbWeight::get().writes(1_u64))
105
	}
106
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
107
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
108
	fn service_page_base_completion() -> Weight {
109
		// Proof Size summary in bytes:
110
		//  Measured:  `147`
111
		//  Estimated: `69049`
112
		// Minimum execution time: 6_220_000 picoseconds.
113
		Weight::from_parts(6_622_000, 69049)
114
			.saturating_add(T::DbWeight::get().reads(1_u64))
115
			.saturating_add(T::DbWeight::get().writes(1_u64))
116
	}
117
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
118
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
119
	fn service_page_base_no_completion() -> Weight {
120
		// Proof Size summary in bytes:
121
		//  Measured:  `147`
122
		//  Estimated: `69049`
123
		// Minimum execution time: 6_342_000 picoseconds.
124
		Weight::from_parts(6_727_000, 69049)
125
			.saturating_add(T::DbWeight::get().reads(1_u64))
126
			.saturating_add(T::DbWeight::get().writes(1_u64))
127
	}
128
	/// Storage: `MessageQueue::BookStateFor` (r:0 w:1)
129
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
130
	/// Storage: `MessageQueue::Pages` (r:0 w:1)
131
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
132
	fn service_page_item() -> Weight {
133
		// Proof Size summary in bytes:
134
		//  Measured:  `0`
135
		//  Estimated: `0`
136
		// Minimum execution time: 112_729_000 picoseconds.
137
		Weight::from_parts(114_076_000, 0)
138
			.saturating_add(T::DbWeight::get().writes(2_u64))
139
	}
140
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
141
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
142
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
143
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
144
	fn bump_service_head() -> Weight {
145
		// Proof Size summary in bytes:
146
		//  Measured:  `246`
147
		//  Estimated: `3514`
148
		// Minimum execution time: 6_836_000 picoseconds.
149
		Weight::from_parts(6_986_000, 3514)
150
			.saturating_add(T::DbWeight::get().reads(2_u64))
151
			.saturating_add(T::DbWeight::get().writes(1_u64))
152
	}
153
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
154
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
155
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
156
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
157
	fn reap_page() -> Weight {
158
		// Proof Size summary in bytes:
159
		//  Measured:  `65744`
160
		//  Estimated: `69049`
161
		// Minimum execution time: 50_733_000 picoseconds.
162
		Weight::from_parts(51_649_000, 69049)
163
			.saturating_add(T::DbWeight::get().reads(2_u64))
164
			.saturating_add(T::DbWeight::get().writes(2_u64))
165
	}
166
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
167
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
168
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
169
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
170
	fn execute_overweight_page_removed() -> Weight {
171
		// Proof Size summary in bytes:
172
		//  Measured:  `65744`
173
		//  Estimated: `69049`
174
		// Minimum execution time: 67_335_000 picoseconds.
175
		Weight::from_parts(68_347_000, 69049)
176
			.saturating_add(T::DbWeight::get().reads(2_u64))
177
			.saturating_add(T::DbWeight::get().writes(2_u64))
178
	}
179
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
180
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
181
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
182
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
183
	fn execute_overweight_page_updated() -> Weight {
184
		// Proof Size summary in bytes:
185
		//  Measured:  `65744`
186
		//  Estimated: `69049`
187
		// Minimum execution time: 77_610_000 picoseconds.
188
		Weight::from_parts(80_338_000, 69049)
189
			.saturating_add(T::DbWeight::get().reads(2_u64))
190
			.saturating_add(T::DbWeight::get().writes(2_u64))
191
	}
192
}
193

            
194
// For backwards compatibility and tests.
195
impl WeightInfo for () {
196
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:0)
197
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
198
	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
199
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
200
	fn ready_ring_knit() -> Weight {
201
		// Proof Size summary in bytes:
202
		//  Measured:  `301`
203
		//  Estimated: `6038`
204
		// Minimum execution time: 11_674_000 picoseconds.
205
		Weight::from_parts(12_105_000, 6038)
206
			.saturating_add(RocksDbWeight::get().reads(3_u64))
207
			.saturating_add(RocksDbWeight::get().writes(2_u64))
208
	}
209
	/// Storage: `MessageQueue::BookStateFor` (r:2 w:2)
210
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
211
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
212
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
213
	fn ready_ring_unknit() -> Weight {
214
		// Proof Size summary in bytes:
215
		//  Measured:  `301`
216
		//  Estimated: `6038`
217
		// Minimum execution time: 10_262_000 picoseconds.
218
		Weight::from_parts(10_654_000, 6038)
219
			.saturating_add(RocksDbWeight::get().reads(3_u64))
220
			.saturating_add(RocksDbWeight::get().writes(3_u64))
221
	}
222
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
223
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
224
	fn service_queue_base() -> Weight {
225
		// Proof Size summary in bytes:
226
		//  Measured:  `76`
227
		//  Estimated: `3514`
228
		// Minimum execution time: 4_363_000 picoseconds.
229
		Weight::from_parts(4_589_000, 3514)
230
			.saturating_add(RocksDbWeight::get().reads(1_u64))
231
			.saturating_add(RocksDbWeight::get().writes(1_u64))
232
	}
233
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
234
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
235
	fn service_page_base_completion() -> Weight {
236
		// Proof Size summary in bytes:
237
		//  Measured:  `147`
238
		//  Estimated: `69049`
239
		// Minimum execution time: 6_220_000 picoseconds.
240
		Weight::from_parts(6_622_000, 69049)
241
			.saturating_add(RocksDbWeight::get().reads(1_u64))
242
			.saturating_add(RocksDbWeight::get().writes(1_u64))
243
	}
244
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
245
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
246
	fn service_page_base_no_completion() -> Weight {
247
		// Proof Size summary in bytes:
248
		//  Measured:  `147`
249
		//  Estimated: `69049`
250
		// Minimum execution time: 6_342_000 picoseconds.
251
		Weight::from_parts(6_727_000, 69049)
252
			.saturating_add(RocksDbWeight::get().reads(1_u64))
253
			.saturating_add(RocksDbWeight::get().writes(1_u64))
254
	}
255
	/// Storage: `MessageQueue::BookStateFor` (r:0 w:1)
256
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
257
	/// Storage: `MessageQueue::Pages` (r:0 w:1)
258
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
259
	fn service_page_item() -> Weight {
260
		// Proof Size summary in bytes:
261
		//  Measured:  `0`
262
		//  Estimated: `0`
263
		// Minimum execution time: 112_729_000 picoseconds.
264
		Weight::from_parts(114_076_000, 0)
265
			.saturating_add(RocksDbWeight::get().writes(2_u64))
266
	}
267
	/// Storage: `MessageQueue::ServiceHead` (r:1 w:1)
268
	/// Proof: `MessageQueue::ServiceHead` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
269
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:0)
270
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
271
	fn bump_service_head() -> Weight {
272
		// Proof Size summary in bytes:
273
		//  Measured:  `246`
274
		//  Estimated: `3514`
275
		// Minimum execution time: 6_836_000 picoseconds.
276
		Weight::from_parts(6_986_000, 3514)
277
			.saturating_add(RocksDbWeight::get().reads(2_u64))
278
			.saturating_add(RocksDbWeight::get().writes(1_u64))
279
	}
280
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
281
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
282
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
283
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
284
	fn reap_page() -> Weight {
285
		// Proof Size summary in bytes:
286
		//  Measured:  `65744`
287
		//  Estimated: `69049`
288
		// Minimum execution time: 50_733_000 picoseconds.
289
		Weight::from_parts(51_649_000, 69049)
290
			.saturating_add(RocksDbWeight::get().reads(2_u64))
291
			.saturating_add(RocksDbWeight::get().writes(2_u64))
292
	}
293
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
294
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
295
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
296
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
297
	fn execute_overweight_page_removed() -> Weight {
298
		// Proof Size summary in bytes:
299
		//  Measured:  `65744`
300
		//  Estimated: `69049`
301
		// Minimum execution time: 67_335_000 picoseconds.
302
		Weight::from_parts(68_347_000, 69049)
303
			.saturating_add(RocksDbWeight::get().reads(2_u64))
304
			.saturating_add(RocksDbWeight::get().writes(2_u64))
305
	}
306
	/// Storage: `MessageQueue::BookStateFor` (r:1 w:1)
307
	/// Proof: `MessageQueue::BookStateFor` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
308
	/// Storage: `MessageQueue::Pages` (r:1 w:1)
309
	/// Proof: `MessageQueue::Pages` (`max_values`: None, `max_size`: Some(65584), added: 68059, mode: `MaxEncodedLen`)
310
	fn execute_overweight_page_updated() -> Weight {
311
		// Proof Size summary in bytes:
312
		//  Measured:  `65744`
313
		//  Estimated: `69049`
314
		// Minimum execution time: 77_610_000 picoseconds.
315
		Weight::from_parts(80_338_000, 69049)
316
			.saturating_add(RocksDbWeight::get().reads(2_u64))
317
			.saturating_add(RocksDbWeight::get().writes(2_u64))
318
	}
319
}