Make wasm runtime cache size configurable (#10177)

* Make wasm runtime cache size configurable

* apply review comments

* remove VersionedRuntimeValue

* fix compilation

* VersionedRuntime: replace clone by Arc

* fmt

* fix warnings

* fix tests compilation

* fmt
This commit is contained in:
Éloïs
2021-12-09 16:10:16 +01:00
committed by GitHub
parent 6ce90f583c
commit 3acd335a8d
30 changed files with 139 additions and 79 deletions
@@ -104,6 +104,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
tracing_targets: None,
tracing_receiver: Default::default(),
max_runtime_instances: 8,
runtime_cache_size: 2,
announce_block: true,
base_path: Some(base_path),
informant_output_format: Default::default(),
@@ -96,6 +96,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
tracing_targets: None,
tracing_receiver: Default::default(),
max_runtime_instances: 8,
runtime_cache_size: 2,
announce_block: true,
base_path: Some(base_path),
informant_output_format: Default::default(),
+1
View File
@@ -161,6 +161,7 @@ pub fn new_partial(
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);
let (client, backend, keystore_container, task_manager) =
+1 -1
View File
@@ -194,7 +194,7 @@ fn bench_execute_block(c: &mut Criterion) {
ExecutionMethod::Wasm(wasm_method) => (false, wasm_method),
};
let executor = NativeElseWasmExecutor::new(wasm_method, None, 8);
let executor = NativeElseWasmExecutor::new(wasm_method, None, 8, 2);
let runtime_code = RuntimeCode {
code_fetcher: &sp_core::traits::WrappedRuntimeCode(compact_code_unwrap().into()),
hash: vec![1, 2, 3],
+1 -1
View File
@@ -96,7 +96,7 @@ pub fn from_block_number(n: u32) -> Header {
}
pub fn executor() -> NativeElseWasmExecutor<ExecutorDispatch> {
NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8)
NativeElseWasmExecutor::new(WasmExecutionMethod::Interpreted, None, 8, 2)
}
pub fn executor_call<
@@ -41,6 +41,7 @@ impl InspectCmd {
config.wasm_method,
config.default_heap_pages,
config.max_runtime_instances,
config.runtime_cache_size,
);
let client = new_full_client::<B, RA, _>(&config, None, executor)?;
+1 -1
View File
@@ -400,7 +400,7 @@ impl BenchDb {
let backend = sc_service::new_db_backend(db_config).expect("Should not fail");
let client = sc_service::new_client(
backend.clone(),
NativeElseWasmExecutor::new(WasmExecutionMethod::Compiled, None, 8),
NativeElseWasmExecutor::new(WasmExecutionMethod::Compiled, None, 8, 2),
&keyring.generate_genesis(),
None,
None,