Measure the memory usage of HashMap better
Open
Nobody has claimed this yet.
I-perf-bloat
- Dominant language
- Rust
- Stars
- 38k
- Forks
- 3.8k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 465
Description
Currently we estimate it at capacity() * (size_of::<K>() + size_of::<V>()). I briefly looked into duplicating the internals in mem.rs, but it was looked really complicated.
Contributor guide
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 reading the memory-measurement code in mem.rs and the HashMap internals it currently avoids duplicating. Compare the existing capacity() * (size_of::() + size_of::()) estimate with the actual allocation layout, and consider the work complete when HashMap memory usage is measured more accurately without relying on an impractical duplication of internals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100