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

update weights (0.9.31) #6173

Closed
wants to merge 5 commits into from
Closed

Conversation

coderobe
Copy link
Contributor

let's find out if they're good this time around! 🏋️‍♀️

@coderobe coderobe added A0-please_review Pull request needs code review. B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Oct 21, 2022
@coderobe coderobe mentioned this pull request Oct 21, 2022
14 tasks
Copy link
Contributor

@EgorPopelyaev EgorPopelyaev left a comment

Choose a reason for hiding this comment

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

There are a lot of big jumps again from 0 to billion values

.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))
Weight::from_ref_time(5_472_372_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

big jump from 0 -> 5_472_372_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))
Weight::from_ref_time(4_270_710_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here from 0 -> 4_270_710_000

Copy link
Member

@ggwpez ggwpez Oct 21, 2022

Choose a reason for hiding this comment

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

Even the worst case improvement is 31.8% here, so it is better now.
The crux is that the components do not start at 0, as you can see code comment above the function.
SWC now evaluates both formulas at all corners and compares them to find the worst case improvement. In this case:

27106660000  vs 18355259455 (-32.285056679797506) [d = 5, v = 1.00K]
41586660000  vs 23769227455 (-42.844105645897024) [d = 5, v = 2.00K]
54885312000  vs 37430538656 (-31.802266777676323) [d = 16, v = 1.00K]
69365312000  vs 42844506656 (-38.233527074743066) [d = 16, v = 2.00K]

// Standard Error: 17_000
.saturating_add(Weight::from_ref_time(180_000 as u64).saturating_mul(d as u64))
fn elect_queued(a: u32, _d: u32, ) -> Weight {
Weight::from_ref_time(389_938_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 389_938_000

// Standard Error: 35_000
.saturating_add(Weight::from_ref_time(2_257_000 as u64).saturating_mul(d as u64))
fn submit_unsigned(_v: u32, _t: u32, a: u32, _d: u32, ) -> Weight {
Weight::from_ref_time(6_923_558_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 6_923_558_000

// Standard Error: 63_000
.saturating_add(Weight::from_ref_time(1_598_000 as u64).saturating_mul(d as u64))
fn feasibility_check(v: u32, _t: u32, a: u32, _d: u32, ) -> Weight {
Weight::from_ref_time(6_146_628_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

again 0 -> 6_146_628_000

.saturating_add(Weight::from_ref_time(24_156_000 as u64).saturating_mul(n as u64))
.saturating_add(T::DbWeight::get().reads(187 as u64))
.saturating_add(T::DbWeight::get().reads((5 as u64).saturating_mul(v as u64)))
Weight::from_ref_time(441_118_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 441_118_000

.saturating_add(T::DbWeight::get().reads((4 as u64).saturating_mul(n as u64)))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
fn get_npos_voters(v: u32, n: u32, _s: u32, ) -> Weight {
Weight::from_ref_time(25_869_841_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 25_869_841_000

.saturating_add(Weight::from_ref_time(6_515_000 as u64).saturating_mul(v as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(v as u64)))
Weight::from_ref_time(3_445_194_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 3_445_194_000

.saturating_add(T::DbWeight::get().writes(1 as u64))
.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(c as u64)))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(t as u64)))
Weight::from_ref_time(548_530_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 548_530_000

.saturating_add(T::DbWeight::get().writes(4 as u64))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(i as u64)))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(e as u64)))
Weight::from_ref_time(859_684_000 as u64)
Copy link
Contributor

Choose a reason for hiding this comment

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

0 -> 859_684_000

@coderobe coderobe requested a review from ggwpez October 21, 2022 09:04
@ggwpez
Copy link
Member

ggwpez commented Oct 21, 2022

SWC link: https://weights.tasty.limo/compare?old=v0.9.30&new=release-v0.9.31&threshold=30&unit=time&repo=polkadot&path_pattern=runtime/**/src/weights/**/*.rs&method=guess-worst&ignore_errors=true

cc @ggwpez

That compares against release-v0.9.31 but this MR is against coderobe/weights-31. @chevdor

.saturating_add(T::DbWeight::get().reads(256 as u64))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(i as u64)))
.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(e as u64)))
.saturating_add(T::DbWeight::get().writes(384 as u64))
Copy link
Member

@ggwpez ggwpez Oct 21, 2022

Choose a reason for hiding this comment

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

We cannot use that. Same problem as here paritytech/cumulus#1784
And should be fixed in paritytech/substrate#12482

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants