diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-05-30 01:16:56 +0200 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-05-30 01:16:56 +0200 |
| commit | 7c3fd68f703d944b05dcea08f3a46c59b41503f4 (patch) | |
| tree | 4588645c28ea9775ae39f4875b019f72269dbb6f /benchmarks/benches/fibonacci.rs | |
| parent | ffb1e095fc1d6a2d54cc7637797c625dee6ebe6a (diff) | |
chore: cleanup
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'benchmarks/benches/fibonacci.rs')
| -rw-r--r-- | benchmarks/benches/fibonacci.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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"))); } |
