pallet_example_basic/weights.rs
1// This file is part of Substrate.
2
3// SPDX-License-Identifier: MIT-0
4
5// Permission is hereby granted, free of charge, to any person obtaining a copy of
6// this software and associated documentation files (the "Software"), to deal in
7// the Software without restriction, including without limitation the rights to
8// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9// of the Software, and to permit persons to whom the Software is furnished to do
10// so, subject to the following conditions:
11
12// The above copyright notice and this permission notice shall be included in all
13// copies or substantial portions of the Software.
14
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21// SOFTWARE.
22
23//! Autogenerated weights for pallet_example_basic
24//!
25//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
26//! DATE: 2022-10-09, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
27//! HOSTNAME: `Shawns-MacBook-Pro.local`, CPU: `<UNKNOWN>`
28//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
29
30// Executed Command:
31// ./target/release/substrate
32// benchmark
33// pallet
34// --chain=dev
35// --execution=wasm
36// --wasm-execution=compiled
37// --pallet=pallet_example_basic
38// --extrinsic=*
39// --steps=50
40// --repeat=20
41// --output=./
42// --template
43// ./.maintain/frame-weight-template.hbs
44
45#![cfg_attr(rustfmt, rustfmt_skip)]
46#![allow(unused_parens)]
47#![allow(unused_imports)]
48
49use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50use core::marker::PhantomData;
51
52/// Weight functions needed for pallet_example_basic.
53pub trait WeightInfo {
54 fn set_dummy_benchmark() -> Weight;
55 fn accumulate_dummy() -> Weight;
56 fn sort_vector(x: u32, ) -> Weight;
57}
58
59/// Weights for pallet_example_basic using the Substrate node and recommended hardware.
60pub struct SubstrateWeight<T>(PhantomData<T>);
61impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
62 // Storage: BasicExample Dummy (r:0 w:1)
63 fn set_dummy_benchmark() -> Weight {
64 Weight::from_parts(19_000_000 as u64, 0)
65 .saturating_add(T::DbWeight::get().writes(1 as u64))
66 }
67 // Storage: BasicExample Dummy (r:1 w:1)
68 fn accumulate_dummy() -> Weight {
69 Weight::from_parts(18_000_000 as u64, 0)
70 .saturating_add(T::DbWeight::get().reads(1 as u64))
71 .saturating_add(T::DbWeight::get().writes(1 as u64))
72 }
73 /// The range of component `x` is `[0, 10000]`.
74 fn sort_vector(x: u32, ) -> Weight {
75 Weight::from_parts(0 as u64, 0)
76 // Standard Error: 2
77 .saturating_add(Weight::from_parts(520 as u64, 0).saturating_mul(x as u64))
78 }
79}
80
81// For backwards compatibility and tests
82impl WeightInfo for () {
83 // Storage: BasicExample Dummy (r:0 w:1)
84 fn set_dummy_benchmark() -> Weight {
85 Weight::from_parts(19_000_000 as u64, 0)
86 .saturating_add(RocksDbWeight::get().writes(1 as u64))
87 }
88 // Storage: BasicExample Dummy (r:1 w:1)
89 fn accumulate_dummy() -> Weight {
90 Weight::from_parts(18_000_000 as u64, 0)
91 .saturating_add(RocksDbWeight::get().reads(1 as u64))
92 .saturating_add(RocksDbWeight::get().writes(1 as u64))
93 }
94 /// The range of component `x` is `[0, 10000]`.
95 fn sort_vector(x: u32, ) -> Weight {
96 Weight::from_parts(0 as u64, 0)
97 // Standard Error: 2
98 .saturating_add(Weight::from_parts(520 as u64, 0).saturating_mul(x as u64))
99 }
100}