mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
committed by
Gav Wood
parent
a4e5842915
commit
5b28147d27
@@ -17,10 +17,14 @@
|
||||
//! A `CodeExecutor` specialisation which uses natively compiled runtime when the wasm to be
|
||||
//! executed is equivalent to the natively compiled code.
|
||||
|
||||
#![cfg_attr(feature = "benchmarks", feature(test))]
|
||||
|
||||
extern crate node_runtime;
|
||||
#[macro_use] extern crate substrate_executor;
|
||||
#[cfg_attr(test, macro_use)] extern crate substrate_primitives as primitives;
|
||||
|
||||
#[cfg(feature = "benchmarks")] extern crate test;
|
||||
|
||||
#[cfg(test)] extern crate substrate_keyring as keyring;
|
||||
#[cfg(test)] extern crate sr_primitives as runtime_primitives;
|
||||
#[cfg(test)] extern crate srml_support as runtime_support;
|
||||
@@ -747,4 +751,19 @@ mod tests {
|
||||
|
||||
assert!(t.storage_changes_root(Default::default(), 0).is_some());
|
||||
}
|
||||
|
||||
#[cfg(feature = "benchmarks")]
|
||||
mod benches {
|
||||
use super::*;
|
||||
use test::Bencher;
|
||||
|
||||
#[bench]
|
||||
fn wasm_execute_block(b: &mut Bencher) {
|
||||
b.iter(|| {
|
||||
let mut t = new_test_ext(false);
|
||||
WasmExecutor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block1(false).0).unwrap();
|
||||
WasmExecutor::new().call(&mut t, 8, COMPACT_CODE, "execute_block", &block2().0).unwrap();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user