common_runtime/weights/
rocksdb_child_trie_weights.rs

1//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 48.0.0
2//! DATE: 2025-10-22 (Y/M/D)
3//! HOSTNAME: `ip-10-173-4-131`, CPU: `Intel(R) Xeon(R) Platinum 8488C`
4//!
5//! DATABASE: `RocksDb`, RUNTIME: `Frequency`
6//! BLOCK-NUM: `BlockId::Number(9443452)`
7//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `2`
8//! STATE-VERSION: `V1`, STATE-CACHE-SIZE: ``
9//! WEIGHT-PATH: ``
10//! METRIC: `Average`, WEIGHT-MUL: `1.3`, WEIGHT-ADD: `0`
11
12// Executed Command:
13//   ./frequency/target/release/frequency
14//   benchmark
15//   storage
16//   --state-version=1
17//   --chain=frequency
18//   --base-path=/data
19//   --warmups=2
20//   --mul=1.3
21
22/// Storage DB weights for the `Frequency` runtime and `RocksDb`.
23pub mod constants {
24	use frame_support::weights::constants;
25	use sp_core::parameter_types;
26	use sp_weights::RuntimeDbWeight;
27
28	parameter_types! {
29		/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
30		/// the runtime.
31		pub const RocksDbWeightChild: RuntimeDbWeight = RuntimeDbWeight {
32			// Time to read one storage item.
33			// Calculated by multiplying the *Average* of all values with `1.3` and adding `0`.
34			//
35			// Stats nanoseconds:
36			//   Min, Max: 61_748, 44_331_136
37			//   Average:  2_370_750
38			//   Median:   2_255_865
39			//   Std-Dev:  1148296.92
40			//
41			// Percentiles nanoseconds:
42			//   99th: 5_622_557
43			//   95th: 4_546_929
44			//   75th: 3_024_267
45			read: 3_081_975 * constants::WEIGHT_REF_TIME_PER_NANOS,
46
47			// Time to write one storage item.
48			// Calculated by multiplying the *Average* of all values with `1.3` and adding `0`.
49			//
50			// Stats nanoseconds:
51			//   Min, Max: 6_606, 21_531_239
52			//   Average:  31_890
53			//   Median:   29_097
54			//   Std-Dev:  93545.35
55			//
56			// Percentiles nanoseconds:
57			//   99th: 64_921
58			//   95th: 50_484
59			//   75th: 35_177
60			write: 41_457 * constants::WEIGHT_REF_TIME_PER_NANOS,
61		};
62	}
63
64	#[cfg(test)]
65	mod test_db_weights {
66		use super::constants::RocksDbWeight as W;
67		use sp_weights::constants;
68
69		/// Checks that all weights exist and have sane values.
70		// NOTE: If this test fails but you are sure that the generated values are fine,
71		// you can delete it.
72		#[test]
73		fn bound() {
74			// At least 1 µs.
75			assert!(
76				W::get().reads(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
77				"Read weight should be at least 1 µs."
78			);
79			assert!(
80				W::get().writes(1).ref_time() >= constants::WEIGHT_REF_TIME_PER_MICROS,
81				"Write weight should be at least 1 µs."
82			);
83			// At most 1 ms.
84			assert!(
85				W::get().reads(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
86				"Read weight should be at most 1 ms."
87			);
88			assert!(
89				W::get().writes(1).ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
90				"Write weight should be at most 1 ms."
91			);
92		}
93	}
94}