summaryrefslogtreecommitdiff
path: root/benches/util
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-01-30 01:12:38 +0100
committerHenry Gressmann <mail@henrygressmann.de>2024-01-30 01:12:38 +0100
commit893396aa3ce270280a2a1a87007a4b84edc8b898 (patch)
tree59690b8bee97a158a01dd49f4b6e611bdf284546 /benches/util
parent4919d8c2f86f69f669a1afba2a28d5c344fe7197 (diff)
perf: add more benchmarks
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'benches/util')
-rw-r--r--benches/util/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/benches/util/mod.rs b/benches/util/mod.rs
index 69510a5..aa7b418 100644
--- a/benches/util/mod.rs
+++ b/benches/util/mod.rs
@@ -30,3 +30,13 @@ pub fn wasmi(wasm: &[u8]) -> (wasmi::Module, wasmi::Store<()>, wasmi::Linker<()>
let linker = <Linker<()>>::new(&engine);
(module, store, linker)
}
+
+pub fn wasmer(wasm: &[u8]) -> (wasmer::Store, wasmer::Instance) {
+ use wasmer::*;
+ let engine: Engine = wasmer::Singlepass::default().into();
+ let mut store = Store::default();
+ let import_object = imports! {};
+ let module = wasmer::Module::from_binary(&engine, &wasm).expect("wasmer::Module::from_binary");
+ let instance = Instance::new(&mut store, &module, &import_object).expect("Instance::new");
+ (store, instance)
+}