diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-05-15 13:38:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-15 13:38:13 +0200 |
| commit | d9cdd0b53c870bf7d9d69b854b8da2692d152871 (patch) | |
| tree | 0ba0bf6a38ce391495ef42e4f22954aafe3fbbc1 /benchmarks | |
| parent | e771c6df456f6c6655a7850defffdbb5cc574461 (diff) | |
feat: v0.7.0 (#13)
* Remove all unsafe code
* Refactor interpreter loop
* Optimize Call-frames
* Remove unnecessary reference counter data from store
---------
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'benchmarks')
| -rw-r--r-- | benchmarks/Cargo.toml | 6 | ||||
| -rw-r--r-- | benchmarks/benches/selfhosted.rs | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index f2cfe69..e137a92 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -5,10 +5,10 @@ edition.workspace=true [dependencies] criterion={version="0.5", features=["html_reports"]} -tinywasm={path="../crates/tinywasm", features=["unsafe"]} -wat={version="1.206"} +tinywasm={path="../crates/tinywasm"} +wat={version="1"} wasmi={version="0.31", features=["std"]} -wasmer={version="4.2", features=["cranelift", "singlepass"]} +wasmer={version="4.3", features=["cranelift", "singlepass"]} argon2={version="0.5"} [[bench]] diff --git a/benchmarks/benches/selfhosted.rs b/benchmarks/benches/selfhosted.rs index 21ea79f..4241eea 100644 --- a/benchmarks/benches/selfhosted.rs +++ b/benchmarks/benches/selfhosted.rs @@ -1,5 +1,5 @@ mod util; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::{black_box, criterion_group, criterion_main, Criterion}; fn run_native() { use tinywasm::*; @@ -53,6 +53,13 @@ fn run_wasmer(wasm: &[u8]) { const TINYWASM: &[u8] = include_bytes!("../../examples/rust/out/tinywasm.wasm"); fn criterion_benchmark(c: &mut Criterion) { { + let mut group = c.benchmark_group("selfhosted-parse"); + group.bench_function("tinywasm", |b| { + b.iter(|| tinywasm::Module::parse_bytes(black_box(TINYWASM)).expect("parse")) + }); + } + + { let mut group = c.benchmark_group("selfhosted"); group.bench_function("native", |b| b.iter(run_native)); group.bench_function("tinywasm", |b| b.iter(|| run_tinywasm(TINYWASM))); |
