topsoil_core/weights/block_weights.rs
1// This file is part of Soil.
2
3// Copyright (C) Soil contributors.
4// Copyright (C) Parity Technologies (UK) Ltd.
5// SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later WITH Classpath-exception-2.0
6
7//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
8//! DATE: 2024-11-08 (Y/M/D)
9//! HOSTNAME: `runner-wiukf8gn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
10//!
11//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development`
12//! WARMUPS: `10`, REPEAT: `100`
13//! WEIGHT-PATH: `./substrate/frame/support/src/weights/`
14//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
15
16// Executed Command:
17// ./target/production/soil-test-staging-node
18// benchmark
19// overhead
20// --chain=dev
21// --wasm-execution=compiled
22// --weight-path=./substrate/frame/support/src/weights/
23// --header=./substrate/HEADER
24// --warmup=10
25// --repeat=100
26
27use subsoil::core::parameter_types;
28use subsoil::weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
29
30parameter_types! {
31 /// Weight of executing an empty block.
32 /// Calculated by multiplying the *Average* with `1.0` and adding `0`.
33 ///
34 /// Stats nanoseconds:
35 /// Min, Max: 419_969, 685_012
36 /// Average: 431_614
37 /// Median: 427_388
38 /// Std-Dev: 26437.34
39 ///
40 /// Percentiles nanoseconds:
41 /// 99th: 456_205
42 /// 95th: 443_420
43 /// 75th: 431_833
44 pub const BlockExecutionWeight: Weight =
45 Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(431_614), 0);
46}
47
48#[cfg(test)]
49mod test_weights {
50 use subsoil::weights::constants;
51
52 /// Checks that the weight exists and is sane.
53 // NOTE: If this test fails but you are sure that the generated values are fine,
54 // you can delete it.
55 #[test]
56 fn sane() {
57 let w = super::BlockExecutionWeight::get();
58
59 // At least 100 µs.
60 assert!(
61 w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
62 "Weight should be at least 100 µs."
63 );
64 // At most 50 ms.
65 assert!(
66 w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
67 "Weight should be at most 50 ms."
68 );
69 }
70}