Co #10897: Storage benchmarking (#4982)

* Add storage benchmarking

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2022-02-25 21:24:29 +01:00
committed by GitHub
parent d946582707
commit 86f2d65a72
3 changed files with 204 additions and 162 deletions
+185 -162
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -54,6 +54,9 @@ pub enum Subcommand {
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
#[clap(name = "benchmark-storage", about = "Benchmark storage speed.")]
BenchmarkStorage(frame_benchmarking_cli::StorageCmd),
/// Runs performance checks such as PVF compilation in order to measure machine
/// capabilities of running a validator.
HostPerfCheck,
+16
View File
@@ -475,6 +475,22 @@ pub fn run() -> Result<()> {
#[cfg(not(feature = "polkadot-native"))]
panic!("No runtime feature (polkadot, kusama, westend, rococo) is enabled")
},
Some(Subcommand::BenchmarkStorage(cmd)) => {
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;
set_default_ss58_version(chain_spec);
Ok(runner.async_run(|mut config| {
let (client, backend, _, task_manager) = service::new_chain_ops(&mut config, None)?;
let db = backend.expose_db();
let storage = backend.expose_storage();
Ok((
cmd.run(config, client, db, storage).map_err(Error::SubstrateCli),
task_manager,
))
})?)
},
Some(Subcommand::HostPerfCheck) => {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(true);