Skip to content
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

Replace default std hasher with rustc-hash #121

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

Paul1365972
Copy link
Contributor

The default std HashMap/HashSet uses a cryptograpthic hash function (SipHash), this is definitely overkill. Since we don't need to protect against Hash DoS we can just use the same hash function that the rust compiler internally uses. The lower hash quality, and therefore resulting higher collision count, are offset by the drastically faster hashing algorithm.

I would have liked to replace all instances of HashMap, but that would mean also changing the nbt crate. Maybe a possible future enhancement. Anyways, the most important use cases are covered by this commit.

@StackDoubleFlow
Copy link
Member

Thanks!

@StackDoubleFlow StackDoubleFlow merged commit fe76380 into MCHPR:master Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants