From 5d15a5f0f1ababa22a7102f4753ec3acac227a4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Thu, 6 Oct 2022 12:12:11 +0200 Subject: [PATCH] The bencher interface of the test crate in nightly changed. (#391) --- benches/memory_mapping.rs | 39 +++++++++++++++++++++------------------ benches/vm_execution.rs | 4 ++++ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/benches/memory_mapping.rs b/benches/memory_mapping.rs index 5a362d8e..d85ac0eb 100644 --- a/benches/memory_mapping.rs +++ b/benches/memory_mapping.rs @@ -66,20 +66,23 @@ macro_rules! bench_gapped_randomized_access_with_1024_entries { frame_size, false, )]; - bencher.bench(|bencher| { - let config = Config::default(); - let memory_mapping = $mem::new(memory_regions.clone(), &config).unwrap(); - let mut prng = new_prng!(); - bencher.iter(|| { - assert!(memory_mapping - .map( - AccessType::Load, - 0x100000000 + (prng.gen::() % frame_count * (frame_size * 2)), - 1 - ) - .is_ok()); - }); - }); + bencher + .bench(|bencher| { + let config = Config::default(); + let memory_mapping = $mem::new(memory_regions.clone(), &config).unwrap(); + let mut prng = new_prng!(); + bencher.iter(|| { + assert!(memory_mapping + .map( + AccessType::Load, + 0x100000000 + (prng.gen::() % frame_count * (frame_size * 2)), + 1 + ) + .is_ok()); + }); + Ok(()) + }) + .unwrap(); } }; () => { @@ -199,13 +202,13 @@ macro_rules! bench_randomized_mapping_with_n_entries { } bench_randomized_mapping_with_n_entries!( 1, - bench_randomized_mapping_with_001_entries_aligned, - bench_randomized_mapping_with_001_entries_unaligned + bench_randomized_mapping_with_0001_entries_aligned, + bench_randomized_mapping_with_0001_entries_unaligned ); bench_randomized_mapping_with_n_entries!( 4, - bench_randomized_mapping_with_004_entries_aligned, - bench_randomized_mapping_with_004_entries_unaligned + bench_randomized_mapping_with_0004_entries_aligned, + bench_randomized_mapping_with_0004_entries_unaligned ); bench_randomized_mapping_with_n_entries!( 16, diff --git a/benches/vm_execution.rs b/benches/vm_execution.rs index c47052c6..eb96dc02 100644 --- a/benches/vm_execution.rs +++ b/benches/vm_execution.rs @@ -92,7 +92,9 @@ fn bench_jit_vs_interpreter( assert!(result.is_ok(), "{:?}", result); assert_eq!(vm.get_total_instruction_count(), instruction_meter); }); + Ok(()) }) + .unwrap() .unwrap(); let jit_summary = bencher .bench(|bencher| { @@ -103,7 +105,9 @@ fn bench_jit_vs_interpreter( assert!(result.is_ok(), "{:?}", result); assert_eq!(vm.get_total_instruction_count(), instruction_meter); }); + Ok(()) }) + .unwrap() .unwrap(); println!( "jit_vs_interpreter_ratio={}",