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_session`
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_session
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/session/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_session`.
53
pub trait WeightInfo {
54
	fn set_keys() -> Weight;
55
	fn purge_keys() -> Weight;
56
}
57

            
58
/// Weights for `pallet_session` using the Substrate node and recommended hardware.
59
pub struct SubstrateWeight<T>(PhantomData<T>);
60
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
61
	/// Storage: `Staking::Ledger` (r:1 w:0)
62
	/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
63
	/// Storage: `Session::NextKeys` (r:1 w:1)
64
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
65
	/// Storage: `Session::KeyOwner` (r:6 w:6)
66
	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
67
	fn set_keys() -> Weight {
68
		// Proof Size summary in bytes:
69
		//  Measured:  `1919`
70
		//  Estimated: `17759`
71
		// Minimum execution time: 58_466_000 picoseconds.
72
		Weight::from_parts(59_558_000, 17759)
73
			.saturating_add(T::DbWeight::get().reads(8_u64))
74
			.saturating_add(T::DbWeight::get().writes(7_u64))
75
	}
76
	/// Storage: `Staking::Ledger` (r:1 w:0)
77
	/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
78
	/// Storage: `Session::NextKeys` (r:1 w:1)
79
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
80
	/// Storage: `Session::KeyOwner` (r:0 w:6)
81
	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
82
	fn purge_keys() -> Weight {
83
		// Proof Size summary in bytes:
84
		//  Measured:  `1817`
85
		//  Estimated: `5282`
86
		// Minimum execution time: 41_730_000 picoseconds.
87
		Weight::from_parts(42_476_000, 5282)
88
			.saturating_add(T::DbWeight::get().reads(2_u64))
89
			.saturating_add(T::DbWeight::get().writes(7_u64))
90
	}
91
}
92

            
93
// For backwards compatibility and tests.
94
impl WeightInfo for () {
95
	/// Storage: `Staking::Ledger` (r:1 w:0)
96
	/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
97
	/// Storage: `Session::NextKeys` (r:1 w:1)
98
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
99
	/// Storage: `Session::KeyOwner` (r:6 w:6)
100
	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
101
1242
	fn set_keys() -> Weight {
102
1242
		// Proof Size summary in bytes:
103
1242
		//  Measured:  `1919`
104
1242
		//  Estimated: `17759`
105
1242
		// Minimum execution time: 58_466_000 picoseconds.
106
1242
		Weight::from_parts(59_558_000, 17759)
107
1242
			.saturating_add(RocksDbWeight::get().reads(8_u64))
108
1242
			.saturating_add(RocksDbWeight::get().writes(7_u64))
109
1242
	}
110
	/// Storage: `Staking::Ledger` (r:1 w:0)
111
	/// Proof: `Staking::Ledger` (`max_values`: None, `max_size`: Some(1091), added: 3566, mode: `MaxEncodedLen`)
112
	/// Storage: `Session::NextKeys` (r:1 w:1)
113
	/// Proof: `Session::NextKeys` (`max_values`: None, `max_size`: None, mode: `Measured`)
114
	/// Storage: `Session::KeyOwner` (r:0 w:6)
115
	/// Proof: `Session::KeyOwner` (`max_values`: None, `max_size`: None, mode: `Measured`)
116
990
	fn purge_keys() -> Weight {
117
990
		// Proof Size summary in bytes:
118
990
		//  Measured:  `1817`
119
990
		//  Estimated: `5282`
120
990
		// Minimum execution time: 41_730_000 picoseconds.
121
990
		Weight::from_parts(42_476_000, 5282)
122
990
			.saturating_add(RocksDbWeight::get().reads(2_u64))
123
990
			.saturating_add(RocksDbWeight::get().writes(7_u64))
124
990
	}
125
}