Skip to content

No std hashing - #6333

Draft
Person-93 wants to merge 8 commits into
PyO3:mainfrom
Person-93:no_std_hashing
Draft

No std hashing#6333
Person-93 wants to merge 8 commits into
PyO3:mainfrom
Person-93:no_std_hashing

Conversation

@Person-93

Copy link
Copy Markdown
Contributor

Closes #6329

I've added a new trait in impl_: PyHashable. I used ahash::randome_state::RandomState as the build hasher but that can be replaced by any BuildHasher that can be constructed at compile time.

@codspeed-hq

codspeed-hq Bot commented Aug 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 141 untouched benchmarks
⏩ 6 skipped benchmarks1


Comparing Person-93:no_std_hashing (cbdfc5b) with main (98cf22d)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Person-93

Copy link
Copy Markdown
Contributor Author

I'm having some trouble with the UI tests. They are still failing even after running it with UI_TEST=bless.

@davidhewitt davidhewitt 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.

Thanks for iterating through the ways forward here. I'm not entirely sure about the consequences of adding the ahash dependency or switching the hashing to it.

Would an acceptable alternative be to make the #[pyclass(hash)] option require the std feature for now? We might yet proceed with this option later, but deferring by gating the functionality might be good enough to unblock you?

@Person-93

Copy link
Copy Markdown
Contributor Author

Would an acceptable alternative be to make the #[pyclass(hash)] option require the std feature for now? We might yet proceed with this option later, but deferring by gating the functionality might be good enough to unblock you?

Yes, this would be a good way to unblock this for now.

@Person-93

Copy link
Copy Markdown
Contributor Author

I'm not entirely sure about the consequences of adding the ahash dependency or switching the hashing to it.

I haven't really thought it through thoroughly either, I just wanted to see if something like this could be done so that a properly thought out choice could be implemented later.

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.

DefaultHasher for no_std

2 participants