Feature Request: Add a generic parameter for choosing fallback map type
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 109
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to propose a backward-compatible enhancement that would make the crate more flexible without changing its default behavior.
Feature Request
Add a generic type parameter that allows choosing the fallback map type used when the inline capacity is exceeded.
Today, when the number of elements grows beyond N, SmallMap falls back to a fixed HashMap. This works well for many cases, but some applications would benefit from selecting a different map backend.
Motivation
Different workloads have different needs once maps exceed the inline capacity:
Faster full-map iteration
Some backends (such as IndexMap) have more cache-efficient iteration over medium-sized maps, especially when scanning all entries frequently.
Inline behavior remains unchanged.
Existing users see no behavior changes.
If this sounds reasonable, I’d be happy to attempt a draft PR.
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 SmallMap implementation and the code that switches to the fixed HashMap after inline capacity is exceeded. Review the crate's existing tests and API usage before assessing the generic design; done means callers can choose a fallback map type while existing defaults and inline behavior remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100