Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

update weights (sync with 0.9.33) #6362

Merged
merged 4 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions runtime/kusama/constants/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ smallvec = "1.8.0"
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" }
sp-weights = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", default-features = false , branch = "master" }
Comment on lines +13 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to make it compile since we moved the weight stuff to sp-weights and parameter_types is now imported from sp_core instead of frame_support (dont know why). I think the change was part of the WeightV2 refactor.


[features]
default = ["std"]
std = [
"sp-runtime/std"
"sp-core/std",
"sp-runtime/std",
"sp-weights/std"
]
59 changes: 28 additions & 31 deletions runtime/kusama/constants/src/weights/block_weights.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
// This file is part of Substrate.
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-08-19 (Y/M/D)
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! DATE: 2022-11-16 (Y/M/D)
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//!
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development`
//! WARMUPS: `10`, REPEAT: `100`
//! WEIGHT-PATH: `runtime/kusama/constants/src/weights/`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1`, WEIGHT-ADD: `0`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`

// Executed Command:
// ./target/production/polkadot
Expand All @@ -34,32 +32,31 @@
// --weight-path=runtime/kusama/constants/src/weights/
// --warmup=10
// --repeat=100
// --header=./file_header.txt

use frame_support::{
parameter_types,
weights::{constants::WEIGHT_PER_NANOS, Weight},
};
use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_PER_NANOS, Weight};

parameter_types! {
/// Time to execute an empty block.
/// Calculated by multiplying the *Average* with `1` and adding `0`.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 6_094_385, 6_351_993
/// Average: 6_192_341
/// Median: 6_193_838
/// Std-Dev: 63893.84
/// Min, Max: 6_665_440, 6_986_371
/// Average: 6_731_894
/// Median: 6_723_700
/// Std-Dev: 49280.83
///
/// Percentiles nanoseconds:
/// 99th: 6_332_047
/// 95th: 6_308_225
/// 75th: 6_236_204
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(6_192_341);
/// 99th: 6_876_251
/// 95th: 6_811_463
/// 75th: 6_751_221
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(6_731_894);
}

#[cfg(test)]
mod test_weights {
use frame_support::weights::constants;
use sp_weights::constants;

/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
Expand Down
62 changes: 30 additions & 32 deletions runtime/kusama/constants/src/weights/extrinsic_weights.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
// This file is part of Substrate.
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Copyright (C) 2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-20 (Y/M/D)
//! DATE: 2022-11-16 (Y/M/D)
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//!
//! SHORT-NAME: `extrinsic`, LONG-NAME: `ExtrinsicBase`, RUNTIME: `Development`
//! WARMUPS: `10`, REPEAT: `100`
//! WEIGHT-PATH: `runtime/kusama/constants/src/weights/`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1`, WEIGHT-ADD: `0`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`

// Executed Command:
// ./target/production/polkadot
Expand All @@ -33,32 +32,31 @@
// --weight-path=runtime/kusama/constants/src/weights/
// --warmup=10
// --repeat=100
// --header=./file_header.txt

use frame_support::{
parameter_types,
weights::{constants::WEIGHT_PER_NANOS, Weight},
};
use sp_core::parameter_types;
use sp_weights::{constants::WEIGHT_PER_NANOS, Weight};

parameter_types! {
/// Time to execute a NO-OP extrinsic, for example `System::remark`.
/// Calculated by multiplying the *Average* with `1` and adding `0`.
/// Calculated by multiplying the *Average* with `1.0` and adding `0`.
///
/// Stats [NS]:
/// Min, Max: 85_946, 88_408
/// Average: 86_309
/// Median: 86_213
/// Std-Dev: 345.03
/// Stats nanoseconds:
/// Min, Max: 94_359, 96_436
/// Average: 94_889
/// Median: 94_839
/// Std-Dev: 369.49
///
/// Percentiles [NS]:
/// 99th: 87_527
/// 95th: 86_901
/// 75th: 86_308
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(86_309);
/// Percentiles nanoseconds:
/// 99th: 96_279
/// 95th: 95_584
/// 75th: 95_005
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(94_889);
}

#[cfg(test)]
mod test_weights {
use frame_support::weights::constants;
use sp_weights::constants;

/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
Expand Down
48 changes: 28 additions & 20 deletions runtime/kusama/src/weights/frame_benchmarking_baseline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
//! Autogenerated weights for `frame_benchmarking::baseline`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! DATE: 2022-11-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024

// Executed Command:
Expand All @@ -38,54 +38,62 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight}};
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for `frame_benchmarking::baseline`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_benchmarking::baseline::WeightInfo for WeightInfo<T> {
/// The range of component `i` is `[0, 1000000]`.
fn addition(_i: u32, ) -> Weight {
Weight::from_ref_time(114_000 as u64)
// Minimum execution time: 102 nanoseconds.
Weight::from_ref_time(153_256 as u64)
}
/// The range of component `i` is `[0, 1000000]`.
fn subtraction(_i: u32, ) -> Weight {
Weight::from_ref_time(125_000 as u64)
// Minimum execution time: 104 nanoseconds.
Weight::from_ref_time(159_150 as u64)
}
/// The range of component `i` is `[0, 1000000]`.
fn multiplication(_i: u32, ) -> Weight {
Weight::from_ref_time(116_000 as u64)
// Minimum execution time: 106 nanoseconds.
Weight::from_ref_time(155_325 as u64)
}
/// The range of component `i` is `[0, 1000000]`.
fn division(_i: u32, ) -> Weight {
Weight::from_ref_time(115_000 as u64)
// Minimum execution time: 102 nanoseconds.
Weight::from_ref_time(148_483 as u64)
}
/// The range of component `i` is `[0, 100]`.
fn hashing(i: u32, ) -> Weight {
Weight::from_ref_time(19_441_790_000 as u64)
// Standard Error: 126_000
.saturating_add(Weight::from_ref_time(115_000 as u64).saturating_mul(i as u64))
// Minimum execution time: 19_966_061 nanoseconds.
Weight::from_ref_time(20_167_025_347 as u64)
// Standard Error: 298_405
.saturating_add(Weight::from_ref_time(1_324_681 as u64).saturating_mul(i as u64))
}
/// The range of component `i` is `[1, 100]`.
/// The range of component `i` is `[0, 100]`.
fn sr25519_verification(i: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 35_000
.saturating_add(Weight::from_ref_time(47_909_000 as u64).saturating_mul(i as u64))
// Minimum execution time: 136 nanoseconds.
Weight::from_ref_time(174_000 as u64)
// Standard Error: 17_607
.saturating_add(Weight::from_ref_time(47_209_113 as u64).saturating_mul(i as u64))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[0, 1000]`.
fn storage_read(i: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 7_000
.saturating_add(Weight::from_ref_time(1_998_000 as u64).saturating_mul(i as u64))
// Minimum execution time: 145 nanoseconds.
Weight::from_ref_time(154_000 as u64)
// Standard Error: 4_008
.saturating_add(Weight::from_ref_time(1_977_799 as u64).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(i as u64)))
}
// Storage: Skipped Metadata (r:0 w:0)
/// The range of component `i` is `[0, 1000]`.
fn storage_write(i: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(338_000 as u64).saturating_mul(i as u64))
// Minimum execution time: 109 nanoseconds.
Weight::from_ref_time(128_000 as u64)
// Standard Error: 804
.saturating_add(Weight::from_ref_time(325_284 as u64).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(i as u64)))
}
}
28 changes: 15 additions & 13 deletions runtime/kusama/src/weights/frame_election_provider_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
//! Autogenerated weights for `frame_election_provider_support`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! DATE: 2022-11-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024

// Executed Command:
Expand All @@ -38,7 +38,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::{Weight}};
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for `frame_election_provider_support`.
Expand All @@ -48,20 +48,22 @@ impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for We
/// The range of component `t` is `[500, 1000]`.
/// The range of component `d` is `[5, 16]`.
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 56_000
.saturating_add(Weight::from_ref_time(13_944_000 as u64).saturating_mul(v as u64))
// Standard Error: 4_876_000
.saturating_add(Weight::from_ref_time(2_223_649_000 as u64).saturating_mul(d as u64))
// Minimum execution time: 5_474_633 nanoseconds.
Weight::from_ref_time(5_525_752_000 as u64)
// Standard Error: 135_558
.saturating_add(Weight::from_ref_time(5_545_241 as u64).saturating_mul(v as u64))
// Standard Error: 13_859_031
.saturating_add(Weight::from_ref_time(1_538_596_617 as u64).saturating_mul(d as u64))
}
/// The range of component `v` is `[1000, 2000]`.
/// The range of component `t` is `[500, 1000]`.
/// The range of component `d` is `[5, 16]`.
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 79_000
.saturating_add(Weight::from_ref_time(14_480_000 as u64).saturating_mul(v as u64))
// Standard Error: 6_844_000
.saturating_add(Weight::from_ref_time(2_525_332_000 as u64).saturating_mul(d as u64))
// Minimum execution time: 4_309_239 nanoseconds.
Weight::from_ref_time(4_353_424_000 as u64)
// Standard Error: 145_409
.saturating_add(Weight::from_ref_time(5_482_164 as u64).saturating_mul(v as u64))
// Standard Error: 14_866_111
.saturating_add(Weight::from_ref_time(1_765_233_611 as u64).saturating_mul(d as u64))
}
}
Loading