-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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.
Contract weights look good to me. As for the code snippet you posted which is suppose to panic with a div by zero: When looking at the weights it does seem that:
on_initialize_per_queue_item(1) - on_initialize_per_queue_item(0) != 0
Not sure why it panics.
Okay thanks. I looked at the CI output and it seems to run now 👍 |
the weight of System.remark went to 0, the collective test uses a remark call to trigger an out-of-gas condition so I replaced it with a `remark_with_event` call. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
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.
awesome 👍
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 did not check the weights, but I would rename the profile.
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.
Nice! Would be awesome to see a followup where the same is done for the runtime (after the bot is also changed).
bot merge |
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-collective: fix tests the weight of System.remark went to 0, the collective test uses a remark call to trigger an out-of-gas condition so I replaced it with a `remark_with_event` call. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-collective: fix tests the weight of System.remark went to 0, the collective test uses a remark call to trigger an out-of-gas condition so I replaced it with a `remark_with_event` call. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-collective: fix tests the weight of System.remark went to 0, the collective test uses a remark call to trigger an out-of-gas condition so I replaced it with a `remark_with_event` call. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-collective: fix tests the weight of System.remark went to 0, the collective test uses a remark call to trigger an out-of-gas condition so I replaced it with a `remark_with_event` call. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Re-run all benchmarks on reference hardware with optimization flags enabled #10608.
Mostly all weights decreased as you can see in the diff. The few cases where not need some explanation.
👉 Good examples for improvement:
pallet_timpestamp
,utility.batch
Next Steps
Verification
Someone would have to do the same thing that I did and thereby verify that I did not just make the values up 🤣
✔️ Missing pallets
weight.rs
files were not touched; will rerun for those pallets.babe
,grandpa
andmmr
seem to not use automatic benchmarking. They have adefault_weights.rs
instead. How do I update that? -> follow upoffences
' benchmark is currently broken and weights are not updated broken benchmark for pallet_offences (report_offence_im_online) #10027✔️ Weird cases
The weights of substrate itself are not used anyway. They just act as sanity-check.
All really weird changes have been addressed.
Explain the cases where the weight did not just decrease:
Baseline.Hashing
is now ignoring itsi
parameter. Probably the same as frame/benchmarking: baseline weights independent of complexity params polkadot-sdk#400Contracts.{on_initialize_per_trie_key, seal_clear_storage, seal_contains_storage, instr_i64clz}
Democracy.on_initialize_base + _with_launch_period
got more DB writes?!Democracy.unlock_remove
slightly more linear weight but less base weightProxy.remove_announcement
now uses its formerly ignoredp
paramProxy.anonymous
linear weight increase but less baseScheduler.{on_initialize_periodic_resolved, on_initialize_periodic_named_resolved, schedule, schedule_named}
either base or linear increased but the other decreasedStaking.rebond
more linear but less baseTips.{close_tip, tip, tip_new}
higher linear but lower baseTips.slash_tip
MUCH higher linear but lower baseTrasury.approve_proposal
higher linear but lower baseVesting.vested_transfer
highers
linear but lower base andl
System.remark
went to zero and ignores its param nowIn the best case someone just forgot to re-run the benchmarks.
✔️ Cargo.toml
production
profile was created.The optimizations increase the compile time by a lot.
Should they be part of
release
or go in the separateoptimized
profile?target-cpu=native
needs to be configured via env variables in both cases.✔️ Bench bot
... would need to be updated. paritytech/bench-bot#79
✔️ Fix problem in node runtime
Done
The following code inbin/node/runtime/src/lib.rs
now panics withdiv by zero
: