From e4fece35ad1b11e71cd5803021fd7eb09735bf30 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Mon, 26 May 2014 09:00:54 -0700 Subject: [PATCH] Make the bench_struct map test more complicated, 4373ns vs 5355ns --- bench_struct.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bench_struct.rs b/bench_struct.rs index ec215ba8..aed65090 100644 --- a/bench_struct.rs +++ b/bench_struct.rs @@ -423,7 +423,11 @@ fn bench_struct_decoder_inner_empty(b: &mut Bencher) { fn bench_struct_decoder(b: &mut Bencher) { b.iter(|| { let mut map = HashMap::new(); - map.insert("abc".to_strbuf(), Some('c')); + map.insert("1".to_strbuf(), Some('a')); + map.insert("2".to_strbuf(), None); + map.insert("3".to_strbuf(), Some('b')); + map.insert("4".to_strbuf(), None); + map.insert("5".to_strbuf(), Some('c')); let outer = Outer { inner: vec!( @@ -485,7 +489,11 @@ fn bench_struct_deserializer_inner_empty(b: &mut Bencher) { fn bench_struct_deserializer(b: &mut Bencher) { b.iter(|| { let mut map = HashMap::new(); - map.insert("abc".to_strbuf(), Some('c')); + map.insert("1".to_strbuf(), Some('a')); + map.insert("2".to_strbuf(), None); + map.insert("3".to_strbuf(), Some('b')); + map.insert("4".to_strbuf(), None); + map.insert("5".to_strbuf(), Some('c')); let outer = Outer { inner: vec!(