summaryrefslogtreecommitdiff
path: root/benchmarks/benches/util/mod.rs
diff options
context:
space:
mode:
authorHenry Gressmann <mail@henrygressmann.de>2024-06-30 19:19:45 +0200
committerHenry Gressmann <mail@henrygressmann.de>2024-06-30 19:19:45 +0200
commit9c85fa9c3a2066ce851af53d7019e6a25a45af3b (patch)
tree79e6608e97f08c0ebdb64125b0c658f5cc4bb33f /benchmarks/benches/util/mod.rs
parent7e8770cc4e418ef1a8cdfd9b1f59ee14b07cc6c9 (diff)
chore: restructure runtime and reduce build dependencies
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'benchmarks/benches/util/mod.rs')
-rw-r--r--benchmarks/benches/util/mod.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/benchmarks/benches/util/mod.rs b/benchmarks/benches/util/mod.rs
deleted file mode 100644
index 2961046..0000000
--- a/benchmarks/benches/util/mod.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-#![allow(dead_code)]
-
-pub fn tinywasm(wasm: &[u8]) -> (tinywasm::Store, tinywasm::ModuleInstance) {
- use tinywasm::*;
- let module = Module::parse_bytes(wasm).expect("Module::parse_bytes");
- let mut store = Store::default();
- let imports = Imports::default();
- let instance = ModuleInstance::instantiate(&mut store, module, Some(imports)).expect("instantiate");
- (store, instance)
-}
-
-pub fn wasmi(wasm: &[u8]) -> (wasmi::Module, wasmi::Store<()>, wasmi::Linker<()>) {
- use wasmi::*;
- let engine = Engine::default();
- let module = wasmi::Module::new(&engine, wasm).expect("wasmi::Module::new");
- let store = Store::new(&engine, ());
- let linker = <Linker<()>>::new(&engine);
- (module, store, linker)
-}
-
-pub fn wasmer(wasm: &[u8]) -> (wasmer::Store, wasmer::Instance) {
- use wasmer::*;
- let compiler = Singlepass::default();
- let mut store = Store::new(compiler);
- let import_object = imports! {};
- let module = Module::new(&store, wasm).expect("wasmer::Module::new");
- let instance = Instance::new(&mut store, &module, &import_object).expect("Instance::new");
- (store, instance)
-}