Skip to content

Commit

Permalink
Update weights for litmus (#308)
Browse files Browse the repository at this point in the history
* fix arg order of benchmarking

* add time limit to benchmarking

* [benchmarking bot] Auto commit generated weights files (#307)

Co-authored-by: Kailai-Wang <Kailai-Wang@users.noreply.github.com>

* update runtime lib.rs with updated weights

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kailai-Wang <Kailai-Wang@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 19, 2022
1 parent 1e65125 commit a2d264f
Show file tree
Hide file tree
Showing 19 changed files with 694 additions and 299 deletions.
1 change: 1 addition & 0 deletions .github/workflows/benchmark_runtime_weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
# exit status should propagate through ssh
- name: Remotely benchmark pallets ${{ github.event.inputs.pallets }} for ${{ github.event.inputs.chain }}
timeout-minutes: 120
run: |
# prepend the asterisk with \ to go through ssh
arg="${{ github.event.inputs.pallets }}"
Expand Down
4 changes: 2 additions & 2 deletions runtime/litmus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ impl pallet_drop3::Config for Runtime {
type PoolId = u64;
type SetAdminOrigin = EnsureRootOrHalfCouncil;
type Currency = Balances;
type WeightInfo = (); // To be rerun with runtime benchmarks
type WeightInfo = weights::pallet_drop3::WeightInfo<Runtime>;
type SlashPercent = SlashPercent;
type MaximumNameLength = MaximumNameLength;
}
Expand All @@ -904,7 +904,7 @@ impl pallet_extrinsic_filter::Config for Runtime {
type NormalModeFilter = NormalModeFilter;
type SafeModeFilter = SafeModeFilter;
type TestModeFilter = Everything;
type WeightInfo = (); // To be rerun with runtime benchmarks
type WeightInfo = weights::pallet_extrinsic_filter::WeightInfo<Runtime>;
}

construct_runtime! {
Expand Down
44 changes: 26 additions & 18 deletions runtime/litmus/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
// Copyright 2020-2022 Litentry Technologies GmbH.
// This file is part of Litentry.
//
// Litentry 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.
//
// Litentry 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 Litentry. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-11-25, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 20
//! DATE: 2022-01-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("generate-litmus"), DB CACHE: 20

// Executed Command:
// ./litentry-collator
// benchmark
// --chain=dev
// --chain=generate-litmus
// --execution=wasm
// --db-cache=20
// --wasm-execution=compiled
Expand All @@ -17,8 +32,8 @@
// --heap-pages=4096
// --steps=20
// --repeat=50
// --output=./runtime/src/weights/frame_system.rs

// --header=./LICENSE_HEADER
// --output=./runtime/litmus/src/weights/frame_system.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -43,36 +58,29 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
fn set_heap_pages() -> Weight {
(6_128_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a6368616e6765735f74726965] (r:0 w:1)
fn set_changes_trie_config() -> Weight {
(9_868_000 as Weight)
(5_553_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Skipped Metadata (r:0 w:0)
fn set_storage(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((1_118_000 as Weight).saturating_mul(i as Weight))
// Standard Error: 14_000
.saturating_add((1_079_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_storage(i: u32, ) -> Weight {
(2_641_000 as Weight)
(2_204_000 as Weight)
// Standard Error: 1_000
.saturating_add((743_000 as Weight).saturating_mul(i as Weight))
.saturating_add((667_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_prefix(p: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 1_000
.saturating_add((1_097_000 as Weight).saturating_mul(p as Weight))
.saturating_add((1_147_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
}
4 changes: 3 additions & 1 deletion runtime/litmus/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

#![allow(clippy::unnecessary_cast)]

pub mod frame_system;
// pub mod frame_system; // commented out, see lib.rs where `SystemWeightInfo = ()`
pub mod pallet_balances;
pub mod pallet_collator_selection;
pub mod pallet_collective;
pub mod pallet_democracy;
pub mod pallet_drop3;
pub mod pallet_extrinsic_filter;
pub mod pallet_membership;
pub mod pallet_multisig;
pub mod pallet_proxy;
Expand Down
38 changes: 27 additions & 11 deletions runtime/litmus/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
// Copyright 2020-2022 Litentry Technologies GmbH.
// This file is part of Litentry.
//
// Litentry 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.
//
// Litentry 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 Litentry. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-12-09, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 20
//! DATE: 2022-01-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("generate-litmus"), DB CACHE: 20

// Executed Command:
// ./litentry-collator
// benchmark
// --chain=dev
// --chain=generate-litmus
// --execution=wasm
// --db-cache=20
// --wasm-execution=compiled
Expand All @@ -17,7 +32,8 @@
// --heap-pages=4096
// --steps=20
// --repeat=50
// --output=./runtime/src/weights/pallet_balances.rs
// --header=./LICENSE_HEADER
// --output=./runtime/litmus/src/weights/pallet_balances.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -31,43 +47,43 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(78_527_000 as Weight)
(81_411_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(60_151_000 as Weight)
(60_220_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
(33_320_000 as Weight)
(33_668_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
(39_666_000 as Weight)
(40_566_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
(80_093_000 as Weight)
(82_634_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
(73_564_000 as Weight)
(74_036_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight {
(29_941_000 as Weight)
(30_514_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
52 changes: 34 additions & 18 deletions runtime/litmus/src/weights/pallet_collator_selection.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
// Copyright 2020-2022 Litentry Technologies GmbH.
// This file is part of Litentry.
//
// Litentry 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.
//
// Litentry 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 Litentry. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for `pallet_collator_selection`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-12-09, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 20
//! DATE: 2022-01-18, STEPS: `20`, REPEAT: 50, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("generate-litmus"), DB CACHE: 20

// Executed Command:
// ./litentry-collator
// benchmark
// --chain=dev
// --chain=generate-litmus
// --execution=wasm
// --db-cache=20
// --wasm-execution=compiled
Expand All @@ -17,7 +32,8 @@
// --heap-pages=4096
// --steps=20
// --repeat=50
// --output=./runtime/src/weights/pallet_collator_selection.rs
// --header=./LICENSE_HEADER
// --output=./runtime/litmus/src/weights/pallet_collator_selection.rs

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
Expand All @@ -31,19 +47,19 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for WeightInfo<T> {
// Storage: CollatorSelection Invulnerables (r:0 w:1)
fn set_invulnerables(b: u32, ) -> Weight {
(17_993_000 as Weight)
// Standard Error: 0
.saturating_add((44_000 as Weight).saturating_mul(b as Weight))
(17_807_000 as Weight)
// Standard Error: 1_000
.saturating_add((58_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: CollatorSelection DesiredCandidates (r:0 w:1)
fn set_desired_candidates() -> Weight {
(19_656_000 as Weight)
(20_417_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: CollatorSelection CandidacyBond (r:0 w:1)
fn set_candidacy_bond() -> Weight {
(16_394_000 as Weight)
(16_976_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: CollatorSelection Candidates (r:1 w:1)
Expand All @@ -53,26 +69,26 @@ impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for WeightIn
// Storage: CollatorSelection CandidacyBond (r:1 w:0)
// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1)
fn register_as_candidate(c: u32, ) -> Weight {
(77_219_000 as Weight)
(78_609_000 as Weight)
// Standard Error: 6_000
.saturating_add((423_000 as Weight).saturating_mul(c as Weight))
.saturating_add((384_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: CollatorSelection Candidates (r:1 w:1)
// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1)
fn leave_intent(c: u32, ) -> Weight {
(55_689_000 as Weight)
(57_674_000 as Weight)
// Standard Error: 6_000
.saturating_add((498_000 as Weight).saturating_mul(c as Weight))
.saturating_add((466_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:2 w:2)
// Storage: System BlockWeight (r:1 w:1)
// Storage: CollatorSelection LastAuthoredBlock (r:0 w:1)
fn note_author() -> Weight {
(73_539_000 as Weight)
(72_296_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
Expand All @@ -83,10 +99,10 @@ impl<T: frame_system::Config> pallet_collator_selection::WeightInfo for WeightIn
// Storage: System BlockWeight (r:1 w:1)
fn new_session(r: u32, c: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 1_353_000
.saturating_add((11_095_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 1_353_000
.saturating_add((44_435_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 1_344_000
.saturating_add((11_063_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 1_344_000
.saturating_add((44_150_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(r as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(c as Weight)))
Expand Down

0 comments on commit a2d264f

Please sign in to comment.