gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
13.73k stars 1.02k forks source link

Reconsider Choice of HashMap Hasher #6999

Open brody4hire opened 1 month ago

brody4hire commented 1 month ago

As discussed for changes proposed in #6938 - https://github.com/gfx-rs/wgpu/pull/6938#discussion_r1924595463: this project has been using some kind of "fast" hasher from rustc-hash v1, which we are now planning to use with hashbrown, and I have identified some other possible hashers to recommend evaluating:

This kind of decision should be backed up with some benchmark testing.

Context: PR #6938 is part of some preparation I am contributing for no-std support, as requested in: #6826


P.S. I found some older context here, which I would like to comment on:


P.S. 2: Considering that this could affect API, as Fitzgerald noted with the label, I start to wonder if this could have serious impact on any external users?

cwfitzgerald commented 1 month ago

I think I just misclassified this, this isn't exposed to the user.

a1phyr commented 1 month ago

foldhash is the new default hasher from hashbrown, it may also be worth considering.

cwfitzgerald commented 1 month ago

I think the default hashbrown hasher is a very sensible default.

brody4hire commented 1 month ago

https://github.com/xacrimon/dashmap - found this in my GitHub recommendations FWIW