-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
athei
left a comment
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 <[email protected]>
shawntabrizi
left a comment
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 👍
bkchr
left a comment
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.
athei
left a comment
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 <[email protected]> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * 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 <[email protected]>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * 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 <[email protected]>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * 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 <[email protected]>
* Add optimization flags to 'release' profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Optimized weights Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add missing pallets Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Add `production` profile Signed-off-by: Oliver Tale-Yazdi <[email protected]> * 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 <[email protected]>
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.batchNext 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.rsfiles were not touched; will rerun for those pallets.babe,grandpaandmmrseem to not use automatic benchmarking. They have adefault_weights.rsinstead. 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.Hashingis now ignoring itsiparameter. 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_periodgot more DB writes?!Democracy.unlock_removeslightly more linear weight but less base weightProxy.remove_announcementnow uses its formerly ignoredpparamProxy.anonymouslinear 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.rebondmore linear but less baseTips.{close_tip, tip, tip_new}higher linear but lower baseTips.slash_tipMUCH higher linear but lower baseTrasury.approve_proposalhigher linear but lower baseVesting.vested_transferhigherslinear but lower base andlSystem.remarkwent to zero and ignores its param nowIn the best case someone just forgot to re-run the benchmarks.
✔️ Cargo.toml
productionprofile was created.The optimizations increase the compile time by a lot.
Should they be part of
releaseor go in the separateoptimizedprofile?target-cpu=nativeneeds 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.rsnow panics withdiv by zero: