Reset benchmarks by removing post-genesis changes (#5435)

* Reset by removing pos-genesis changes

* CLI option for DB cache size

* Update Cargo.lock

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Arkadiy Paronyan
2020-04-01 14:08:23 +02:00
committed by GitHub
parent 159d830d62
commit 433824511e
4 changed files with 46 additions and 15 deletions
@@ -91,6 +91,10 @@ pub struct BenchmarkCmd {
default_value = "Interpreted"
)]
pub wasm_method: WasmExecutionMethod,
/// Limit the memory the database cache can use.
#[structopt(long = "db-cache", value_name = "MiB", default_value = "128")]
pub database_cache_size: u32,
}
impl BenchmarkCmd {
@@ -116,7 +120,8 @@ impl BenchmarkCmd {
let genesis_storage = spec.build_storage()?;
let mut changes = Default::default();
let state = BenchmarkingState::<BB>::new(genesis_storage)?;
let cache_size = Some(self.database_cache_size as usize);
let state = BenchmarkingState::<BB>::new(genesis_storage, cache_size)?;
let executor = NativeExecutor::<ExecDispatch>::new(
wasm_method,
None, // heap pages