clockworklabs / clockworklabs/SpacetimeDB
Consider switching to `foldhash`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
Hashbrown recently switched to foldhash instead of ahash and maybe we should as well.
Perhaps we should split our hashmap/sets into 3 categories:
- IntMap/Set -- identity hashing, when we don't need a hash at all, in the case of ids.
- FastMap/Set -- using
foldhash-fwhen we don't care about Hash DoS, e.g., when the data comes from the DB state and not from user input. - ResistMap/Set -- using
foldhash-qor some other hasher like siphash.
This could gain us some performance wins.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current ahash-backed map and set definitions and reviewing how hashbrown uses foldhash. Compare the proposed IntMap/Set, FastMap/Set, and ResistMap/Set categories, including their security assumptions and performance tradeoffs. Done requires an agreed design and implementation scope; the issue does not name files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100