Campfyre
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
BolshoyToster@sh.itjust.works to Rust Programming@lemmy.ml · 2 years ago

Question: How is hashbrown faster than the stdlib HashMap?

message-square
message-square
3
fedilink
14
message-square

Question: How is hashbrown faster than the stdlib HashMap?

BolshoyToster@sh.itjust.works to Rust Programming@lemmy.ml · 2 years ago
message-square
3
fedilink

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?

  • crispy_kilt@feddit.de
    link
    fedilink
    arrow-up
    2
    ·
    2 years ago

    Stdlib uses SipHash, not HashBrown.

Rust Programming@lemmy.ml

rust@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 4 users / week
  • 66 users / month
  • 543 users / 6 months
  • 2 local subscribers
  • 8.8K subscribers
  • 257 Posts
  • 892 Comments
  • Modlog
  • mods:
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.ml
  • Nutomic@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org