Conversation
| for (pallet, extrinsic, components, _, pallet_str, extrinsic_str) in benchmarks_to_run.clone() { | ||
| log::info!( | ||
| target: LOG_TARGET, | ||
| "Starting benchmark: {}::{}", |
There was a problem hiding this comment.
| "Starting benchmark: {}::{}", | |
| "Starting benchmark: {pallet_str}::{extrinsic_str}", |
| pallet_str, | ||
| extrinsic_str, |
There was a problem hiding this comment.
| pallet_str, | |
| extrinsic_str, |
| @@ -417,8 +423,8 @@ impl PalletCmd { | |||
| .map_err(|e| { | |||
| format!( | |||
| "Benchmark {}::{} failed: {}", | |||
There was a problem hiding this comment.
| "Benchmark {}::{} failed: {}", | |
| "Benchmark {pallet_str}::{extrinsic_str} failed: {e}", |
| pallet_str, | ||
| extrinsic_str, | ||
| e |
There was a problem hiding this comment.
| pallet_str, | |
| extrinsic_str, | |
| e |
| @@ -495,10 +501,8 @@ impl PalletCmd { | |||
| log::info!( | |||
| target: LOG_TARGET, | |||
| "Running benchmark: {}.{}({} args) {}/{} {}/{}", | |||
There was a problem hiding this comment.
| "Running benchmark: {}.{}({} args) {}/{} {}/{}", | |
| "Running benchmark: {pallet_str}.{extrinsic_str}({} args) {}/{} {}/{}", |
| pallet_str, | ||
| extrinsic_str, |
There was a problem hiding this comment.
| pallet_str, | |
| extrinsic_str, |
| let item = String::from_utf8(key_info.storage_name.clone()) | ||
| .expect("encoded from string"); | ||
| let comment = format!( | ||
| "Proof: `{}::{}` (`max_values`: {:?}, `max_size`: {:?}, mode: `{:?}`)", |
There was a problem hiding this comment.
| "Proof: `{}::{}` (`max_values`: {:?}, `max_size`: {:?}, mode: `{:?}`)", | |
| "Proof: `{pallet_name}::{storage_name}` (`max_values`: {:?}, `max_size`: {:?}, mode: `{:?}`)", |
| let comment = format!( | ||
| "Proof: `{}::{}` (`max_values`: {:?}, `max_size`: {:?}, mode: `{:?}`)", | ||
| pallet, item, key_info.max_values, key_info.max_size, | ||
| pallet_name, storage_name, key_info.max_values, key_info.max_size, |
There was a problem hiding this comment.
| pallet_name, storage_name, key_info.max_values, key_info.max_size, | |
| key_info.max_values, key_info.max_size, |
| let pallet_str = String::from_utf8(pallet.clone()).expect("Encoded from String; qed"); | ||
| let extrinsic_str = String::from_utf8(extrinsic.clone()).expect("Encoded from String; qed"); | ||
| let pov_modes_str = pov_modes.into_iter() |
There was a problem hiding this comment.
Nitpick. In general we don't use Hungarian notation or any variation of it. So in this case I'd rename these variables to just pallet_name, extrinsic_name and pov_modes (as done some files below - writer.rs?)
There was a problem hiding this comment.
Yep, sure thing. I've updated the variable names for pallet_str, extrinsic_str and removed pov_modes_str as pov_modes was already being passed in
|
Thanks for the review @bkchr, all of the comments have been addressed |
| let pov_modes = Self::parse_pov_modes(&benchmarks_to_run)?; | ||
|
|
||
| for (pallet, extrinsic, components, _) in benchmarks_to_run.clone() { | ||
| for (pallet, extrinsic, components, _, pallet_str, extrinsic_str) in benchmarks_to_run.clone() { |
There was a problem hiding this comment.
| for (pallet, extrinsic, components, _, pallet_str, extrinsic_str) in benchmarks_to_run.clone() { | |
| for (pallet, extrinsic, components, _, pallet, extrinsic) in benchmarks_to_run.clone() { |
Types dont need to be in the var name.
| .expect("Encoded from String; qed"), | ||
| String::from_utf8(extrinsic.clone()) | ||
| .expect("Encoded from String; qed"), | ||
| "Running benchmark: {pallet_str}.{extrinsic_str}({} args) {}/{} {}/{}", |
There was a problem hiding this comment.
| "Running benchmark: {pallet_str}.{extrinsic_str}({} args) {}/{} {}/{}", | |
| "Running benchmark: {pallet_str}::{extrinsic_str}({} args) {}/{} {}/{}", |
Noticed recently that it should be consistent with the print above.
| let pallet_string = String::from_utf8(batch.pallet.clone()).unwrap(); | ||
| let instance_string = String::from_utf8(batch.instance.clone()).unwrap(); | ||
| let pallet_name = String::from_utf8(batch.pallet.clone()).unwrap(); | ||
| let instance_name = String::from_utf8(batch.instance.clone()).unwrap(); |
There was a problem hiding this comment.
Originally i thought that already the types in BenchmarkBatchSplitResults and BenchmarkBatch should be converted, but it would mean to duplicate or generitize the types.
Guess this is a good start for now.
|
bot fmt |
|
@ggwpez https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5348374 was started for your command Comment |
|
@ggwpez Command |
…head-data * origin/master: (51 commits) Runtime Upgrade ref docs and Single Block Migration example pallet (#1554) Collator overseer builder unification (#3335) Introduce storage attr macro `#[disable_try_decode_storage]` and set it on `System::Events` and `ParachainSystem::HostConfiguration` (#3454) Add Polkadotters bootnoders per IBP application (#3423) Add documentation around FRAME Origin (#3362) Bridge zombienet tests: Check amount received at destination (#3490) Snowbridge benchmark tests fix (#3424) fix(zombienet): increase timeout in download artifacts (#3376) Cleanup String::from_utf8 (#3446) [prdoc] Validate crate names (#3467) Limit max execution time for `test-linux-stable` CI jobs (#3483) Introduce Notification block pinning limit (#2935) frame-support: Improve error reporting when having too many pallets (#3478) add Encointer as trusted teleporter for Westend (#3411) [pallet-xcm] Adjust benchmarks (teleport_assets/reserve_transfer_assets) not relying on ED (#3464) Add more debug logs to understand if statement-distribution misbehaving (#3419) Remove redundant parachains assigner pallet. (#3457) Use generic hash for runtime wasm in resolve_state_version_from_wasm (#3447) Runtime: allow backing multiple candidates of same parachain on different cores (#3231) Bridge zombienet tests: move all "framework" files under one folder (#3462) ...
# Description *Refactors `String::from_utf8` usage in the pallet benchmarking Fixes paritytech#389 --------- Co-authored-by: command-bot <>
Description
*Refactors
String::from_utf8usage in the pallet benchmarkingFixes #389