@@ -17,9 +17,8 @@ pub fn fibonacci_benchmark(c: &mut Criterion) {
1717 for i in [ 100i64 , 200i64 , 500i64 , 1000i64 , 4000i64 , 8000i64 ] . iter ( ) {
1818 // Run Mun fibonacci
1919 group. bench_with_input ( BenchmarkId :: new ( "mun" , i) , i, |b, i| {
20- let runtime_ref = runtime. borrow ( ) ;
2120 b. iter ( || {
22- let _: i64 = runtime_ref . invoke ( "main" , ( * i, ) ) . unwrap ( ) ;
21+ let _: i64 = runtime . invoke ( "main" , ( * i, ) ) . unwrap ( ) ;
2322 } )
2423 } ) ;
2524
@@ -78,9 +77,8 @@ pub fn empty_benchmark(c: &mut Criterion) {
7877 let mut group = c. benchmark_group ( "empty" ) ;
7978
8079 group. bench_function ( "mun" , |b| {
81- let runtime_ref = runtime. borrow ( ) ;
8280 b. iter ( || {
83- let _: i64 = runtime_ref . invoke ( "empty" , ( black_box ( 20i64 ) , ) ) . unwrap ( ) ;
81+ let _: i64 = runtime . invoke ( "empty" , ( black_box ( 20i64 ) , ) ) . unwrap ( ) ;
8482 } )
8583 } ) ;
8684 group. bench_function ( "rust" , |b| b. iter ( || empty ( black_box ( 20 ) ) ) ) ;
@@ -114,9 +112,8 @@ struct RustParent<'a> {
114112pub fn get_struct_field_benchmark ( c : & mut Criterion ) {
115113 // Perform setup (not part of the benchmark)
116114 let runtime = util:: runtime_from_file ( "struct.mun" ) ;
117- let runtime_ref = runtime. borrow_mut ( ) ;
118- let mun_gc_parent: StructRef = runtime_ref. invoke ( "make_gc_parent" , ( ) ) . unwrap ( ) ;
119- let mun_value_parent: StructRef = runtime_ref. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
115+ let mun_gc_parent: StructRef = runtime. invoke ( "make_gc_parent" , ( ) ) . unwrap ( ) ;
116+ let mun_value_parent: StructRef = runtime. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
120117
121118 let rust_child = RustChild ( -2.0 , -1.0 , 1.0 , 2.0 ) ;
122119 let rust_parent = RustParent {
@@ -203,9 +200,8 @@ pub fn get_struct_field_benchmark(c: &mut Criterion) {
203200pub fn set_struct_field_benchmark ( c : & mut Criterion ) {
204201 // Perform setup (not part of the benchmark)
205202 let runtime = util:: runtime_from_file ( "struct.mun" ) ;
206- let runtime_ref = runtime. borrow ( ) ;
207- let mut mun_gc_parent: StructRef = runtime_ref. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
208- let mut mun_value_parent: StructRef = runtime_ref. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
203+ let mut mun_gc_parent: StructRef = runtime. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
204+ let mut mun_value_parent: StructRef = runtime. invoke ( "make_value_parent" , ( ) ) . unwrap ( ) ;
209205
210206 let rust_child = RustChild ( -2.0 , -1.0 , 1.0 , 2.0 ) ;
211207 let mut rust_child2 = rust_child. clone ( ) ;
0 commit comments