Shopify / Shopify/rubydex

Pre-allocate hash sizes with rough estimation of definitions per file

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

medium performance
Dominant language
Rust
Stars
355
Forks
24
Avg merge
2d 6h
Merged PRs (30d)
17

Description

Resizing hashes can be expensive and we need to do it a lot as we index the codebase. Let's try starting out with a pre-allocated hash using the average number of definitions per file.

We can estimate the average using the Ruby LSP's own indexer.

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 locating the indexer and the hash allocations involved in indexing definitions, then inspect how the Ruby LSP's own indexer could provide the average definitions-per-file estimate. Done means indexing begins with an estimated hash capacity and avoids unnecessary resizing without changing results.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, rust
Domain
devtools, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.