summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/benches/argon2id.rs2
-rw-r--r--benchmarks/benches/fibonacci.rs6
-rw-r--r--benchmarks/benches/selfhosted.rs18
3 files changed, 14 insertions, 12 deletions
diff --git a/benchmarks/benches/argon2id.rs b/benchmarks/benches/argon2id.rs
index e458983..76e1eee 100644
--- a/benchmarks/benches/argon2id.rs
+++ b/benchmarks/benches/argon2id.rs
@@ -35,7 +35,7 @@ fn run_native(params: (i32, i32, i32)) {
run_native(params.0, params.1, params.2)
}
-const ARGON2ID: &[u8] = include_bytes!("../../examples/rust/out/argon2id.wasm");
+static ARGON2ID: &[u8] = include_bytes!("../../examples/rust/out/argon2id.opt.wasm");
fn criterion_benchmark(c: &mut Criterion) {
let params = (1000, 2, 1);
diff --git a/benchmarks/benches/fibonacci.rs b/benchmarks/benches/fibonacci.rs
index 61b9a68..e610ab2 100644
--- a/benchmarks/benches/fibonacci.rs
+++ b/benchmarks/benches/fibonacci.rs
@@ -44,7 +44,7 @@ fn run_native_recursive(n: i32) -> i32 {
run_native_recursive(n - 1) + run_native_recursive(n - 2)
}
-const FIBONACCI: &[u8] = include_bytes!("../../examples/rust/out/fibonacci.wasm");
+static FIBONACCI: &[u8] = include_bytes!("../../examples/rust/out/fibonacci.opt.wasm");
fn criterion_benchmark(c: &mut Criterion) {
// {
// let mut group = c.benchmark_group("fibonacci");
@@ -58,7 +58,9 @@ fn criterion_benchmark(c: &mut Criterion) {
let mut group = c.benchmark_group("fibonacci-recursive");
group.measurement_time(std::time::Duration::from_secs(5));
// group.bench_function("native", |b| b.iter(|| run_native_recursive(black_box(26))));
- group.bench_function("tinywasm", |b| b.iter(|| run_tinywasm(FIBONACCI, black_box(26), "fibonacci_recursive")));
+ group.bench_function("tinywasm", |b| {
+ b.iter(|| run_tinywasm(black_box(FIBONACCI), black_box(26), "fibonacci_recursive"))
+ });
// group.bench_function("wasmi", |b| b.iter(|| run_wasmi(FIBONACCI, black_box(26), "fibonacci_recursive")));
// group.bench_function("wasmer", |b| b.iter(|| run_wasmer(FIBONACCI, black_box(26), "fibonacci_recursive")));
}
diff --git a/benchmarks/benches/selfhosted.rs b/benchmarks/benches/selfhosted.rs
index 441923b..adac85a 100644
--- a/benchmarks/benches/selfhosted.rs
+++ b/benchmarks/benches/selfhosted.rs
@@ -50,21 +50,21 @@ fn run_wasmer(wasm: &[u8]) {
hello.call(&mut store, &[]).expect("call");
}
-const TINYWASM: &[u8] = include_bytes!("../../examples/rust/out/tinywasm.wasm");
+static TINYWASM: &[u8] = include_bytes!("../../examples/rust/out/tinywasm.opt.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 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");
+ 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)));
- // group.bench_function("wasmi", |b| b.iter(|| run_wasmi(TINYWASM)));
- // group.bench_function("wasmer", |b| b.iter(|| run_wasmer(TINYWASM)));
+ group.bench_function("tinywasm", |b| b.iter(|| run_tinywasm(black_box(TINYWASM))));
+ // group.bench_function("wasmi", |b| b.iter(|| run_wasmi(black_box(TINYWASM))));
+ // group.bench_function("wasmer", |b| b.iter(|| run_wasmer(black_box(TINYWASM))));
}
}