We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since Rust 1.36 the HashMap implementation in the standard library should be ported from hashbrown (see #56241)).
But when benchmarking both, hashbrown is a lot faster (3x) on inserts than the HashMap in the standard library:
$ cargo bench running 2 tests test tests::brown ... bench: 4 ns/iter (+/- 3) test tests::std ... bench: 14 ns/iter (+/- 4)
Here is my benchmarking code
#![feature(test)] extern crate test; extern crate hashbrown; #[cfg(test)] mod tests { use test::Bencher; use hashbrown::HashMap as BrownMap; use std::collections::HashMap as StdMap; #[bench] fn brown(b: &mut Bencher) { let mut map = BrownMap::new(); b.iter(|| map.insert(0, 0)); } #[bench] fn std(b: &mut Bencher) { let mut map = StdMap::new(); b.iter(|| map.insert(0, 0)); } }
$ rustc --version --verbose rustc 1.39.0-nightly (b9de4ef89 2019-09-03) binary: rustc commit-hash: b9de4ef89e0e53099a084001b26ec3207c5f8391 commit-date: 2019-09-03 host: x86_64-pc-windows-msvc release: 1.39.0-nightly LLVM version: 9.0
on Windows 10
The text was updated successfully, but these errors were encountered:
This is expected, as std has a different (slower) hasher due to wanting default DDOS protection and such.
Sorry, something went wrong.
No branches or pull requests
Since Rust 1.36 the HashMap implementation in the standard library should be ported from hashbrown (see #56241)).
But when benchmarking both, hashbrown is a lot faster (3x) on inserts than the HashMap in the standard library:
Here is my benchmarking code
Meta
on Windows 10
The text was updated successfully, but these errors were encountered: