Sha256: cb84275f22d5f95a5ac995ac6b2df74ffcf342765b401d27c95f2955c7b7cb9f
Contents?: true
Size: 734 Bytes
Versions: 69
Compression:
Stored size: 734 Bytes
Contents
//! Compare `insert` and `insert_unique_unchecked` operations performance. #![feature(test)] extern crate test; use hashbrown::HashMap; use test::Bencher; #[bench] fn insert(b: &mut Bencher) { let keys: Vec<String> = (0..1000).map(|i| format!("xxxx{}yyyy", i)).collect(); b.iter(|| { let mut m = HashMap::with_capacity(1000); for k in &keys { m.insert(k, k); } m }); } #[bench] fn insert_unique_unchecked(b: &mut Bencher) { let keys: Vec<String> = (0..1000).map(|i| format!("xxxx{}yyyy", i)).collect(); b.iter(|| { let mut m = HashMap::with_capacity(1000); for k in &keys { m.insert_unique_unchecked(k, k); } m }); }
Version data entries
69 entries across 38 versions & 1 rubygems