servo / servo/servo

Measure the memory usage of HashMap better

Open
#6,908 19 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.