Skip to content
This repository has been archived by the owner on Jul 7, 2021. It is now read-only.

Weights from benchmark machine #56

Merged
merged 10 commits into from
May 31, 2021
15 changes: 15 additions & 0 deletions file_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Statemint 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.

// Statemint 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 Statemint. If not, see <http://www.gnu.org/licenses/>.
82 changes: 40 additions & 42 deletions pallets/collator-selection/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,44 @@ pub trait WeightInfo {
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn set_invulnerables(b: u32, ) -> Weight {
(28_060_000 as Weight)
// Standard Error: 1_000
.saturating_add((118_000 as Weight).saturating_mul(b as Weight))
(18_563_000 as Weight)
// Standard Error: 0
.saturating_add((68_000 as Weight).saturating_mul(b as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_desired_candidates() -> Weight {
(25_000_000 as Weight)
(16_363_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_candidacy_bond() -> Weight {
(25_000_000 as Weight)
(16_840_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn register_as_candidate(c: u32, ) -> Weight {
(82_496_000 as Weight)
// Standard Error: 1_000
.saturating_add((266_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
(71_196_000 as Weight)
// Standard Error: 0
.saturating_add((198_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn leave_intent(c: u32, ) -> Weight {
(65_836_000 as Weight)
// Standard Error: 2_000
.saturating_add((273_000 as Weight).saturating_mul(c as Weight))
(55_336_000 as Weight)
// Standard Error: 0
.saturating_add((151_000 as Weight).saturating_mul(c as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn note_author() -> Weight {
(106_000_000 as Weight)
(71_461_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn new_session(r: u32, c: u32, ) -> Weight {
(50_005_000 as Weight)
// Standard Error: 2_000
.saturating_add((8_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 2_000
.saturating_add((291_000 as Weight).saturating_mul(c as Weight))
fn new_session(_r: u32, c: u32, ) -> Weight {
(37_164_000 as Weight)
// Standard Error: 5_000
.saturating_add((5_724_000 as Weight).saturating_mul(c as Weight))
Copy link
Contributor

Choose a reason for hiding this comment

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

that's a quite significant weight change
wanna comment on that?

Copy link
Member

Choose a reason for hiding this comment

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

the logic of this function must have changed (hence the additional read per C below), so dunno what level of explanation you are looking for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also thought this was weird so ended up realizing that the removal logic was slightly changed and I was missing that block, tested this locally, fixed it, running it now on the benchmark machine again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm same results on the benchmark machine (may just be in my head), going to look into this more (gonna have to run the benchmarks again later) for now will merge.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shawntabrizi
I just thought it deserved extra attention and scrutiny 🤷 😄

.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(c as Weight)))
apopiak marked this conversation as resolved.
Show resolved Hide resolved
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
Expand All @@ -83,45 +82,44 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// For backwards compatibility and tests
impl WeightInfo for () {
fn set_invulnerables(b: u32, ) -> Weight {
(28_060_000 as Weight)
// Standard Error: 1_000
.saturating_add((118_000 as Weight).saturating_mul(b as Weight))
(18_563_000 as Weight)
// Standard Error: 0
.saturating_add((68_000 as Weight).saturating_mul(b as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn set_desired_candidates() -> Weight {
(25_000_000 as Weight)
(16_363_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn set_candidacy_bond() -> Weight {
(25_000_000 as Weight)
(16_840_000 as Weight)
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
fn register_as_candidate(c: u32, ) -> Weight {
(82_496_000 as Weight)
// Standard Error: 1_000
.saturating_add((266_000 as Weight).saturating_mul(c as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
(71_196_000 as Weight)
// Standard Error: 0
.saturating_add((198_000 as Weight).saturating_mul(c as Weight))
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
fn leave_intent(c: u32, ) -> Weight {
(65_836_000 as Weight)
// Standard Error: 2_000
.saturating_add((273_000 as Weight).saturating_mul(c as Weight))
(55_336_000 as Weight)
// Standard Error: 0
.saturating_add((151_000 as Weight).saturating_mul(c as Weight))
.saturating_add(RocksDbWeight::get().reads(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
}
fn note_author() -> Weight {
(106_000_000 as Weight)
(71_461_000 as Weight)
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
}
fn new_session(r: u32, c: u32, ) -> Weight {
(50_005_000 as Weight)
// Standard Error: 2_000
.saturating_add((8_000 as Weight).saturating_mul(r as Weight))
// Standard Error: 2_000
.saturating_add((291_000 as Weight).saturating_mul(c as Weight))
fn new_session(_r: u32, c: u32, ) -> Weight {
(37_164_000 as Weight)
// Standard Error: 5_000
.saturating_add((5_724_000 as Weight).saturating_mul(c as Weight))
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(c as Weight)))
.saturating_add(RocksDbWeight::get().writes(1 as Weight))
}
}
94 changes: 43 additions & 51 deletions runtime/statemine/src/weights/pallet_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,21 @@
//! Autogenerated weights for pallet_assets
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-04-21, STEPS: `[20, ]`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemint-dev"), DB CACHE: 128
//! DATE: 2021-05-31, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 128

// Executed Command:
// ./target/release/statemint
// benchmark
// --chain
// statemint-dev
// --execution
// wasm
// --wasm-execution
// compiled
// --pallet
// pallet_assets
// --extrinsic
// *
// --steps
// 20
// --repeat
// 10
// --chain=statemine-dev
// --execution=wasm
// --wasm-execution=compiled
// --pallet=pallet_assets
// --extrinsic=*
// --steps=50
// --repeat=20
// --raw
// --output
// ./
// --output=./runtime/statemine/src/weights/


#![allow(unused_parens)]
Expand All @@ -37,21 +29,23 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
fn create() -> Weight {
(68_000_000 as Weight)
(44_224_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_create() -> Weight {
(34_000_000 as Weight)
(22_533_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn destroy(c: u32, s: u32, a: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 440_000
.saturating_add((33_246_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 440_000
.saturating_add((47_556_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 37_000
.saturating_add((21_529_000 as Weight).saturating_mul(c as Weight))
// Standard Error: 37_000
.saturating_add((28_905_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 377_000
.saturating_add((3_745_000 as Weight).saturating_mul(a as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
Expand All @@ -61,108 +55,106 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight)))
}
fn mint() -> Weight {
(103_000_000 as Weight)
(49_078_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn burn() -> Weight {
(115_000_000 as Weight)
(55_886_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn transfer() -> Weight {
(153_000_000 as Weight)
(84_857_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn transfer_keep_alive() -> Weight {
(124_000_000 as Weight)
(71_330_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn force_transfer() -> Weight {
(145_000_000 as Weight)
(85_127_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn freeze() -> Weight {
(49_000_000 as Weight)
(31_403_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw() -> Weight {
(47_000_000 as Weight)
(31_250_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn freeze_asset() -> Weight {
(34_000_000 as Weight)
(22_097_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw_asset() -> Weight {
(34_000_000 as Weight)
(22_245_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn transfer_ownership() -> Weight {
(39_000_000 as Weight)
(25_479_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_team() -> Weight {
(35_000_000 as Weight)
(22_271_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_metadata(_n: u32, s: u32, ) -> Weight {
(75_032_000 as Weight)
// Standard Error: 20_000
.saturating_add((18_000 as Weight).saturating_mul(s as Weight))
(50_315_000 as Weight)
// Standard Error: 0
.saturating_add((8_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn clear_metadata() -> Weight {
(70_000_000 as Weight)
(48_134_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_set_metadata(n: u32, s: u32, ) -> Weight {
(34_085_000 as Weight)
// Standard Error: 21_000
.saturating_add((48_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 21_000
.saturating_add((53_000 as Weight).saturating_mul(s as Weight))
fn force_set_metadata(_n: u32, s: u32, ) -> Weight {
(25_933_000 as Weight)
// Standard Error: 0
.saturating_add((7_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_clear_metadata() -> Weight {
(73_000_000 as Weight)
(49_243_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_asset_status() -> Weight {
(33_000_000 as Weight)
(22_305_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn approve_transfer() -> Weight {
(67_000_000 as Weight)
(48_885_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn transfer_approved() -> Weight {
(149_000_000 as Weight)
(108_026_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}
fn cancel_approval() -> Weight {
(62_000_000 as Weight)
(48_943_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_cancel_approval() -> Weight {
(71_000_000 as Weight)
(56_914_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
Loading