Revisit vector preallocation in `resolution::sorted_units`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 355
- Forks
- 24
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 17
Description
We're preallocating the vector sizes based on the number of definitions divided by two. I didn't actually measure the ratio to understand the average in real codebases.
We basically have to understand what is the ratio of classes + modules + singleton classes + constant references vs all of the rest of definitions. Do that for a few codebases, get an average and apply that to the code.
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 at resolution::sorted_units and inspect how its vectors are preallocated. Measure the ratio of classes, modules, singleton classes, and constant references to all definitions across several Ruby codebases, then apply the resulting average to the allocation factor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby, rust
- Domain
- performance, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100