1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17

            
18
//! Autogenerated weights for pallet_data_preservers
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
21
//! DATE: 2024-06-07, STEPS: `16`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `pop-os`, CPU: `12th Gen Intel(R) Core(TM) i7-1260P`
24
//! EXECUTION: , WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
25

            
26
// Executed Command:
27
// ./target/release/tanssi-node
28
// benchmark
29
// pallet
30
// --execution=wasm
31
// --wasm-execution=compiled
32
// --pallet
33
// pallet_data_preservers
34
// --extrinsic
35
// *
36
// --chain=dev
37
// --steps
38
// 16
39
// --repeat
40
// 1
41
// --template=benchmarking/frame-weight-pallet-template.hbs
42
// --json-file
43
// raw.json
44
// --output
45
// tmp/pallet_data_preservers.rs
46

            
47
#![cfg_attr(rustfmt, rustfmt_skip)]
48
#![allow(unused_parens)]
49
#![allow(unused_imports)]
50

            
51
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
52
use sp_std::marker::PhantomData;
53

            
54
/// Weight functions needed for pallet_data_preservers.
55
pub trait WeightInfo {
56
	fn create_profile(x: u32, y: u32, ) -> Weight;
57
	fn force_create_profile(x: u32, y: u32, ) -> Weight;
58
	fn update_profile(x: u32, y: u32, ) -> Weight;
59
	fn force_update_profile(x: u32, y: u32, ) -> Weight;
60
	fn delete_profile() -> Weight;
61
	fn force_delete_profile() -> Weight;
62
	fn start_assignment() -> Weight;
63
	fn stop_assignment() -> Weight;
64
	fn force_start_assignment() -> Weight;
65
}
66

            
67
/// Weights for pallet_data_preservers using the Substrate node and recommended hardware.
68
pub struct SubstrateWeight<T>(PhantomData<T>);
69
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
70
	/// Storage: `System::Account` (r:1 w:1)
71
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
72
	/// Storage: `Balances::Holds` (r:1 w:1)
73
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
74
	/// Storage: `DataPreservers::NextProfileId` (r:1 w:1)
75
	/// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
76
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
77
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
78
	/// The range of component `x` is `[1, 200]`.
79
	/// The range of component `y` is `[1, 10]`.
80
	fn create_profile(x: u32, y: u32, ) -> Weight {
81
		// Proof Size summary in bytes:
82
		//  Measured:  `109`
83
		//  Estimated: `3694`
84
		// Minimum execution time: 47_314_000 picoseconds.
85
		Weight::from_parts(47_311_741, 3694)
86
			// Standard Error: 6_992
87
			.saturating_add(Weight::from_parts(16_023, 0).saturating_mul(x.into()))
88
			// Standard Error: 147_505
89
			.saturating_add(Weight::from_parts(152_259, 0).saturating_mul(y.into()))
90
			.saturating_add(T::DbWeight::get().reads(4_u64))
91
			.saturating_add(T::DbWeight::get().writes(4_u64))
92
	}
93
	/// Storage: `DataPreservers::NextProfileId` (r:1 w:1)
94
	/// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
95
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
96
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
97
	/// The range of component `x` is `[1, 200]`.
98
	/// The range of component `y` is `[1, 10]`.
99
	fn force_create_profile(_x: u32, _y: u32, ) -> Weight {
100
		// Proof Size summary in bytes:
101
		//  Measured:  `6`
102
		//  Estimated: `3471`
103
		// Minimum execution time: 16_415_000 picoseconds.
104
		Weight::from_parts(19_640_708, 3471)
105
			.saturating_add(T::DbWeight::get().reads(2_u64))
106
			.saturating_add(T::DbWeight::get().writes(2_u64))
107
	}
108
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
109
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
110
	/// Storage: `System::Account` (r:1 w:1)
111
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
112
	/// Storage: `Balances::Holds` (r:1 w:1)
113
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
114
	/// The range of component `x` is `[1, 200]`.
115
	/// The range of component `y` is `[1, 10]`.
116
	fn update_profile(_x: u32, _y: u32, ) -> Weight {
117
		// Proof Size summary in bytes:
118
		//  Measured:  `315`
119
		//  Estimated: `3780`
120
		// Minimum execution time: 46_710_000 picoseconds.
121
		Weight::from_parts(86_406_571, 3780)
122
			.saturating_add(T::DbWeight::get().reads(3_u64))
123
			.saturating_add(T::DbWeight::get().writes(3_u64))
124
	}
125
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
126
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
127
	/// Storage: `System::Account` (r:1 w:1)
128
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
129
	/// Storage: `Balances::Holds` (r:1 w:1)
130
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
131
	/// The range of component `x` is `[1, 200]`.
132
	/// The range of component `y` is `[1, 10]`.
133
	fn force_update_profile(_x: u32, _y: u32, ) -> Weight {
134
		// Proof Size summary in bytes:
135
		//  Measured:  `315`
136
		//  Estimated: `3780`
137
		// Minimum execution time: 44_033_000 picoseconds.
138
		Weight::from_parts(47_196_385, 3780)
139
			.saturating_add(T::DbWeight::get().reads(3_u64))
140
			.saturating_add(T::DbWeight::get().writes(3_u64))
141
	}
142
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
143
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
144
	/// Storage: `System::Account` (r:1 w:1)
145
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
146
	/// Storage: `Balances::Holds` (r:1 w:1)
147
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
148
	fn delete_profile() -> Weight {
149
		// Proof Size summary in bytes:
150
		//  Measured:  `315`
151
		//  Estimated: `3780`
152
		// Minimum execution time: 44_490_000 picoseconds.
153
		Weight::from_parts(44_490_000, 3780)
154
			.saturating_add(T::DbWeight::get().reads(3_u64))
155
			.saturating_add(T::DbWeight::get().writes(3_u64))
156
	}
157
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
158
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
159
	/// Storage: `System::Account` (r:1 w:1)
160
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
161
	/// Storage: `Balances::Holds` (r:1 w:1)
162
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
163
	fn force_delete_profile() -> Weight {
164
		// Proof Size summary in bytes:
165
		//  Measured:  `315`
166
		//  Estimated: `3780`
167
		// Minimum execution time: 45_933_000 picoseconds.
168
		Weight::from_parts(45_933_000, 3780)
169
			.saturating_add(T::DbWeight::get().reads(3_u64))
170
			.saturating_add(T::DbWeight::get().writes(3_u64))
171
	}
172
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
173
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: None, mode: `Measured`)
174
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
175
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
176
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
177
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
178
	fn start_assignment() -> Weight {
179
		// Proof Size summary in bytes:
180
		//  Measured:  `373`
181
		//  Estimated: `3838`
182
		// Minimum execution time: 27_104_000 picoseconds.
183
		Weight::from_parts(27_104_000, 3838)
184
			.saturating_add(T::DbWeight::get().reads(3_u64))
185
			.saturating_add(T::DbWeight::get().writes(2_u64))
186
	}
187
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
188
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: None, mode: `Measured`)
189
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
190
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
191
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
192
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
193
	fn stop_assignment() -> Weight {
194
		// Proof Size summary in bytes:
195
		//  Measured:  `430`
196
		//  Estimated: `3895`
197
		// Minimum execution time: 26_600_000 picoseconds.
198
		Weight::from_parts(26_600_000, 3895)
199
			.saturating_add(T::DbWeight::get().reads(3_u64))
200
			.saturating_add(T::DbWeight::get().writes(2_u64))
201
	}
202
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
203
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
204
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
205
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
206
	fn force_start_assignment() -> Weight {
207
		// Proof Size summary in bytes:
208
		//  Measured:  `153`
209
		//  Estimated: `3618`
210
		// Minimum execution time: 19_437_000 picoseconds.
211
		Weight::from_parts(19_437_000, 3618)
212
			.saturating_add(T::DbWeight::get().reads(2_u64))
213
			.saturating_add(T::DbWeight::get().writes(2_u64))
214
	}
215
}
216

            
217
// For backwards compatibility and tests
218
impl WeightInfo for () {
219
	/// Storage: `System::Account` (r:1 w:1)
220
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
221
	/// Storage: `Balances::Holds` (r:1 w:1)
222
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
223
	/// Storage: `DataPreservers::NextProfileId` (r:1 w:1)
224
	/// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
225
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
226
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
227
	/// The range of component `x` is `[1, 200]`.
228
	/// The range of component `y` is `[1, 10]`.
229
	fn create_profile(x: u32, y: u32, ) -> Weight {
230
		// Proof Size summary in bytes:
231
		//  Measured:  `109`
232
		//  Estimated: `3694`
233
		// Minimum execution time: 47_314_000 picoseconds.
234
		Weight::from_parts(47_311_741, 3694)
235
			// Standard Error: 6_992
236
			.saturating_add(Weight::from_parts(16_023, 0).saturating_mul(x.into()))
237
			// Standard Error: 147_505
238
			.saturating_add(Weight::from_parts(152_259, 0).saturating_mul(y.into()))
239
			.saturating_add(RocksDbWeight::get().reads(4_u64))
240
			.saturating_add(RocksDbWeight::get().writes(4_u64))
241
	}
242
	/// Storage: `DataPreservers::NextProfileId` (r:1 w:1)
243
	/// Proof: `DataPreservers::NextProfileId` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
244
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
245
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
246
	/// The range of component `x` is `[1, 200]`.
247
	/// The range of component `y` is `[1, 10]`.
248
	fn force_create_profile(_x: u32, _y: u32, ) -> Weight {
249
		// Proof Size summary in bytes:
250
		//  Measured:  `6`
251
		//  Estimated: `3471`
252
		// Minimum execution time: 16_415_000 picoseconds.
253
		Weight::from_parts(19_640_708, 3471)
254
			.saturating_add(RocksDbWeight::get().reads(2_u64))
255
			.saturating_add(RocksDbWeight::get().writes(2_u64))
256
	}
257
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
258
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
259
	/// Storage: `System::Account` (r:1 w:1)
260
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
261
	/// Storage: `Balances::Holds` (r:1 w:1)
262
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
263
	/// The range of component `x` is `[1, 200]`.
264
	/// The range of component `y` is `[1, 10]`.
265
	fn update_profile(_x: u32, _y: u32, ) -> Weight {
266
		// Proof Size summary in bytes:
267
		//  Measured:  `315`
268
		//  Estimated: `3780`
269
		// Minimum execution time: 46_710_000 picoseconds.
270
		Weight::from_parts(86_406_571, 3780)
271
			.saturating_add(RocksDbWeight::get().reads(3_u64))
272
			.saturating_add(RocksDbWeight::get().writes(3_u64))
273
	}
274
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
275
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
276
	/// Storage: `System::Account` (r:1 w:1)
277
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
278
	/// Storage: `Balances::Holds` (r:1 w:1)
279
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
280
	/// The range of component `x` is `[1, 200]`.
281
	/// The range of component `y` is `[1, 10]`.
282
	fn force_update_profile(_x: u32, _y: u32, ) -> Weight {
283
		// Proof Size summary in bytes:
284
		//  Measured:  `315`
285
		//  Estimated: `3780`
286
		// Minimum execution time: 44_033_000 picoseconds.
287
		Weight::from_parts(47_196_385, 3780)
288
			.saturating_add(RocksDbWeight::get().reads(3_u64))
289
			.saturating_add(RocksDbWeight::get().writes(3_u64))
290
	}
291
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
292
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
293
	/// Storage: `System::Account` (r:1 w:1)
294
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
295
	/// Storage: `Balances::Holds` (r:1 w:1)
296
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
297
	fn delete_profile() -> Weight {
298
		// Proof Size summary in bytes:
299
		//  Measured:  `315`
300
		//  Estimated: `3780`
301
		// Minimum execution time: 44_490_000 picoseconds.
302
		Weight::from_parts(44_490_000, 3780)
303
			.saturating_add(RocksDbWeight::get().reads(3_u64))
304
			.saturating_add(RocksDbWeight::get().writes(3_u64))
305
	}
306
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
307
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
308
	/// Storage: `System::Account` (r:1 w:1)
309
	/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
310
	/// Storage: `Balances::Holds` (r:1 w:1)
311
	/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(229), added: 2704, mode: `MaxEncodedLen`)
312
	fn force_delete_profile() -> Weight {
313
		// Proof Size summary in bytes:
314
		//  Measured:  `315`
315
		//  Estimated: `3780`
316
		// Minimum execution time: 45_933_000 picoseconds.
317
		Weight::from_parts(45_933_000, 3780)
318
			.saturating_add(RocksDbWeight::get().reads(3_u64))
319
			.saturating_add(RocksDbWeight::get().writes(3_u64))
320
	}
321
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
322
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: None, mode: `Measured`)
323
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
324
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
325
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
326
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
327
	fn start_assignment() -> Weight {
328
		// Proof Size summary in bytes:
329
		//  Measured:  `373`
330
		//  Estimated: `3838`
331
		// Minimum execution time: 27_104_000 picoseconds.
332
		Weight::from_parts(27_104_000, 3838)
333
			.saturating_add(RocksDbWeight::get().reads(3_u64))
334
			.saturating_add(RocksDbWeight::get().writes(2_u64))
335
	}
336
	/// Storage: `Registrar::ParaManager` (r:1 w:0)
337
	/// Proof: `Registrar::ParaManager` (`max_values`: None, `max_size`: None, mode: `Measured`)
338
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
339
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
340
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
341
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
342
	fn stop_assignment() -> Weight {
343
		// Proof Size summary in bytes:
344
		//  Measured:  `430`
345
		//  Estimated: `3895`
346
		// Minimum execution time: 26_600_000 picoseconds.
347
		Weight::from_parts(26_600_000, 3895)
348
			.saturating_add(RocksDbWeight::get().reads(3_u64))
349
			.saturating_add(RocksDbWeight::get().writes(2_u64))
350
	}
351
	/// Storage: `DataPreservers::Profiles` (r:1 w:1)
352
	/// Proof: `DataPreservers::Profiles` (`max_values`: None, `max_size`: None, mode: `Measured`)
353
	/// Storage: `DataPreservers::Assignments` (r:1 w:1)
354
	/// Proof: `DataPreservers::Assignments` (`max_values`: None, `max_size`: None, mode: `Measured`)
355
	fn force_start_assignment() -> Weight {
356
		// Proof Size summary in bytes:
357
		//  Measured:  `153`
358
		//  Estimated: `3618`
359
		// Minimum execution time: 19_437_000 picoseconds.
360
		Weight::from_parts(19_437_000, 3618)
361
			.saturating_add(RocksDbWeight::get().reads(2_u64))
362
			.saturating_add(RocksDbWeight::get().writes(2_u64))
363
	}
364
}