mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
benches: disable caching per default (#12232)
* Disable cache for storage benches Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Disable caching per default Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update utils/frame/benchmarking-cli/src/storage/cmd.rs Co-authored-by: Bastian Köcher <info@kchr.de> * Add --enable-trie-cache to 'storage' command Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
committed by
GitHub
parent
b494167d16
commit
9bbede8e00
@@ -75,6 +75,12 @@ pub struct OverheadParams {
|
||||
/// Good for adding LICENSE headers.
|
||||
#[clap(long, value_name = "PATH")]
|
||||
pub header: Option<PathBuf>,
|
||||
|
||||
/// Enable the Trie cache.
|
||||
///
|
||||
/// This should only be used for performance analysis and not for final results.
|
||||
#[clap(long)]
|
||||
pub enable_trie_cache: bool,
|
||||
}
|
||||
|
||||
/// Type of a benchmark.
|
||||
@@ -156,4 +162,12 @@ impl CliConfiguration for OverheadCmd {
|
||||
fn import_params(&self) -> Option<&ImportParams> {
|
||||
Some(&self.import_params)
|
||||
}
|
||||
|
||||
fn trie_cache_maximum_size(&self) -> Result<Option<usize>> {
|
||||
if self.params.enable_trie_cache {
|
||||
Ok(self.import_params().map(|x| x.trie_cache_maximum_size()).unwrap_or_default())
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user