I’m a developer (please ignore/forgive the NFT stuff).

  • 1 Post
  • 0 Comments
Joined 1Y ago
cake
Cake day: Jun 10, 2023

help-circle
rss
Question: How is hashbrown faster than the stdlib HashMap?
I'm curious as to how the [hashbrown](https://github.com/rust-lang/hashbrown) crate can have [up to 2x performance on certain operations](https://friendlyuser.github.io/posts/tech/rust/Accelerating_HashMap_Performance_in_Rust_with_Hashbrown/), even though [it looks like the standard library's HashMap is just a wrapper for hashbrown](https://github.com/rust-lang/rust/blob/5aa23be6b6cde95ab8fd7f01399b40a31a0f8df6/library/std/src/collections/hash/map.rs#L6). I understand that a wrapper could add a small overhead, but 50% of the original performance is a bit silly, especially considering all of the functions in the wrapper are `#[inline]`, so there should be no overhead in calling most functions. Does anyone know the reason for this?
fedilink