You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use a single HashMap implementation consistently across the code base #677
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)
We are using both std::collections::HashMap and hashbrown::HashMap in datafusion, it would be better to consistently use only one of them.
hashbrown's official readme has the following statement:
Since Rust 1.36, this is now the HashMap implementation for the Rust standard library. However you may still want to use this crate instead since it works in environments without std, such as embedded systems and kernels.
However, it's unclear whether Rust std also uses ahash as the default hasher. If not, it seems like hashbrown would still be a better choice when it comes to performance.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
It exposes some more APIs like RawEntry, which can avoid hashing / looking up elements twice.
It is slightly faster than the version included with Rust std, not only because of aHash (vs SipHasher used in std), but also some further optimizations / inlining.
I think best would be to define a HashMap type alias, so we can use whatever is set by default across the project.
Activity
Dandandan commentedon Jul 4, 2021
The hash brown crate is used for those reasons:
RawEntry, which can avoid hashing / looking up elements twice.I think best would be to define a
HashMaptype alias, so we can use whatever is set by default across the project.houqp commentedon Jul 5, 2021
Agreed, I think we should move all HashMap import to our own pluggable type alias and set
hashbrown::HashMapas the default.alamb commentedon Jul 5, 2021
hashbrown::HashMapis a good choice 👍 in my opinionUpgrade datafusion 39 (apache#728)