Replace `ahash` with `rapidhash` by fanninpm · Pull Request #7954 · RustPython/RustPython · GitHub
Skip to content

Replace ahash with rapidhash - #7954

Merged
youknowone merged 5 commits into
RustPython:mainfrom
fanninpm:replace-ahash-with-rapidhash
May 25, 2026
Merged

youknowone merged 5 commits into
RustPython:mainfrom
fanninpm:replace-ahash-with-rapidhash

Conversation

@fanninpm

@fanninpm fanninpm commented May 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #7800.

Back in 2021, ahash was added to RustPython in #2397 because it was faster than the Rust standard library hash/RandomState.
Since then, hashing technology has evolved to the point where rapidhash beats ahash in both the SMHasher and SMHasher3 test suites.
Additionally, rapidhash has very minimal direct dependencies and is portable across CPU architectures.

cc @coolreader18 @joshuamegnauth54

Summary by CodeRabbit

  • Chores
    • Replaced the workspace hashing dependency with an alternative implementation and updated usages across crates for consistent hashing behavior.
    • Adjusted dependency grouping so the previous hash crate is no longer included in the automated grouping/configuration.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown
Contributor

@ShaharNaveh ShaharNaveh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to adjust dependabot as well?

@fanninpm

Copy link
Copy Markdown
Contributor Author

@fanninpm
fanninpm marked this pull request as ready for review May 24, 2026 03:46
@fanninpm
fanninpm force-pushed the replace-ahash-with-rapidhash branch from fd63103 to 133a66c Compare May 24, 2026 14:30

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@youknowone
youknowone merged commit bc3d00e into RustPython:main May 25, 2026
26 checks passed
@fanninpm
fanninpm deleted the replace-ahash-with-rapidhash branch May 26, 2026 03:00
youknowone pushed a commit that referenced this pull request Sep 16, 2026
* Add `rapidhash` to list of dependencies

* Use `rapidhash::quality::RandomState` in `codegen` crate

* Use `rapidhash::quality::RandomState` in `stdlib` crate

* Use `rapidhash::quality::RandomState` in `vm` crate

* Remove `ahash` from lists of dependencies
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.

3 participants