-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, looks like some of the weights have not been updated in a year!
I am currently writing a tool as side project which automates the review process…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spotted a few "big" changes in the review but the weights remained rather stable overall.
fn on_initialize_nothing() -> Weight { | ||
(23_878_000 as Weight).saturating_add(T::DbWeight::get().reads(8 as Weight)) | ||
(12_441_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(8 as Weight)) | ||
} | ||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Around 50% reduction for the election provider and phragmen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea this is since they were not updated since paritytech/substrate#10692. although they should have been 🤷
// Storage: PhragmenElection Candidates (r:1 w:0) | ||
// Storage: PhragmenElection Members (r:1 w:0) | ||
// Storage: PhragmenElection RunnersUp (r:1 w:0) | ||
// Storage: PhragmenElection Voting (r:1 w:1) | ||
// Storage: Balances Locks (r:1 w:1) | ||
fn vote_equal(v: u32, ) -> Weight { | ||
(20_639_000 as Weight) | ||
// Standard Error: 7_000 | ||
.saturating_add((200_000 as Weight).saturating_mul(v as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
fn vote_more(v: u32) -> Weight { | ||
(83_389_000 as Weight) | ||
.saturating_add((341_000 as Weight).saturating_mul(v as Weight)) | ||
// Storage: PhragmenElection Candidates (r:1 w:0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: Around 50% reduction for the election provider and phragmen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can likely be attributed to the fact that those weights hadn't been updated in well over a year
// Storage: Preimage StatusFor (r:1 w:1) | ||
// Storage: Scheduler Lookup (r:0 w:1) | ||
fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { | ||
(0 as Weight) | ||
// Standard Error: 28_000 | ||
.saturating_add((23_540_000 as Weight).saturating_mul(s as Weight)) | ||
(1_758_000 as Weight) | ||
// Standard Error: 30_000 | ||
.saturating_add((24_061_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big change
fn on_initialize_named_resolved(s: u32, ) -> Weight { | ||
(1_922_000 as Weight) | ||
// Standard Error: 21_000 | ||
.saturating_add((18_731_000 as Weight).saturating_mul(s as Weight)) | ||
(452_000 as Weight) | ||
// Standard Error: 29_000 | ||
.saturating_add((19_512_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big change
fn on_initialize(n: u32, ) -> Weight { | ||
(2_126_000 as Weight) | ||
// Standard Error: 19_000 | ||
.saturating_add((48_336_000 as Weight).saturating_mul(n as Weight)) | ||
(0 as Weight) | ||
// Standard Error: 20_000 | ||
.saturating_add((49_389_000 as Weight).saturating_mul(n as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big change
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { | ||
fn remark(b: u32, ) -> Weight { | ||
(0 as Weight) | ||
(2_551_000 as Weight) | ||
// Standard Error: 0 | ||
.saturating_add((1_000 as Weight).saturating_mul(b as Weight)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big increase
// Storage: Staking ForceEra (r:1 w:0) | ||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:1 w:0) | ||
fn on_initialize_nothing() -> Weight { | ||
(23_878_000 as Weight).saturating_add(T::DbWeight::get().reads(8 as Weight)) | ||
(12_276_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(8 as Weight)) | ||
} | ||
// Storage: ElectionProviderMultiPhase Round (r:1 w:0) | ||
// Storage: ElectionProviderMultiPhase CurrentPhase (r:0 w:1) | ||
fn on_initialize_open_signed() -> Weight { | ||
(34_547_000 as Weight) | ||
(11_448_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50%-ish decrease in pallet
// Storage: Preimage StatusFor (r:1 w:1) | ||
// Storage: Scheduler Lookup (r:0 w:1) | ||
fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { | ||
(0 as Weight) | ||
// Standard Error: 31_000 | ||
.saturating_add((23_661_000 as Weight).saturating_mul(s as Weight)) | ||
(1_442_000 as Weight) | ||
// Standard Error: 60_000 | ||
.saturating_add((24_552_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big increase
// Storage: Preimage PreimageFor (r:1 w:1) | ||
// Storage: Preimage StatusFor (r:1 w:1) | ||
fn on_initialize_periodic_resolved(s: u32, ) -> Weight { | ||
(847_000 as Weight) | ||
(34_000 as Weight) | ||
// Standard Error: 29_000 | ||
.saturating_add((21_351_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add((22_211_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(1 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big decrease
// Storage: Auctions ReservedAmounts (r:2 w:2) | ||
// Storage: System Account (r:2 w:2) | ||
fn on_initialize(n: u32, ) -> Weight { | ||
(2_735_000 as Weight) | ||
// Standard Error: 17_000 | ||
.saturating_add((46_633_000 as Weight).saturating_mul(n as Weight)) | ||
(0 as Weight) | ||
// Standard Error: 18_000 | ||
.saturating_add((49_564_000 as Weight).saturating_mul(n as Weight)) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight))) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
big decrease
bot merge |
🏋️
see release PR here