1 #![feature(test)] 2 3 extern crate ralloc; 4 extern crate test; 5 6 #[global_allocator] 7 static ALLOCATOR: ralloc::Allocator = ralloc::Allocator; 8 9 #[bench] 10 fn bench_box(b: &mut test::Bencher) { 11 b.iter(|| { 12 let _bx1 = Box::new(0xF000D); 13 let _bx2 = Box::new(0xF0002); 14 15 "abc".to_owned().into_boxed_str() 16 }); 17 } 18