Question: How is hashbrown faster than the stdlib HashMap?
from BolshoyToster@sh.itjust.works to rust@lemmy.ml on 11 Oct 2023 16:22
https://sh.itjust.works/post/6995475
from BolshoyToster@sh.itjust.works to rust@lemmy.ml on 11 Oct 2023 16:22
https://sh.itjust.works/post/6995475
I’m curious as to how the hashbrown crate can have up to 2x performance on certain operations, even though it looks like the standard library’s HashMap is just a wrapper for hashbrown.
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?
threaded - newest