-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Firefox, Naga may prefer std
's default DOS-resistant hash functions
#2499
Labels
Comments
The algorithm used in FxHasher originally comes from Firefox and is widely used there: https://searchfox.org/mozilla-central/rev/57f6fbd39c0b5957e11b27b4db58b821d8e1607d/mfbt/HashFunctions.h#111 I think it's probably the right default and wouldn't worry about benchmarking. |
Sounds good. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Naga uses these types for nearly all the hash functions in the crate:
These type aliases replace the standard library's hash function, designed to make
std::collections::HashMap
andHashSet
resistant to denial-of-service attacks, with faster, more predictable hash functions.This may not be the right tradeoff for Firefox. We should benchmark to see how much it would cost to just
std::collections
' default settings, and if the cost is minor, we should makeFxHasher
an option. (If the cost is minor enough, we should just dropFxHasher
altogether...)See also: #2498
The text was updated successfully, but these errors were encountered: