Shopify / Shopify/rubydex

Add parallelism to the resolution phase

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

Nobody has claimed this yet.

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

Description

We need to add parallelism to speed up our resolution phase. Our resolution phase actually has two steps:

We cannot perform the two steps simultaneously, they must happen in order. For example, we can't associate a method definition with the class that owns it if we haven't created the class declaration yet.

I believe we will actually parallelize the two steps separately. We divide into workers for resolving constants, converge with results and then divide again to handle the remaining definitions.

Note that the two steps have different requirements. The constant resolution step needs the ability to retry in case we can't resolve something yet, but that's not true of the remaining definitions which will either be created or discarded if it depends on a constant we failed to resolve.

Design the parallelism for this phase so that we can squeeze as much performance as possible.

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 in rust/saturn/src/resolution.rs at the constant-name resolution step around line 62 and the non-constant definition step around line 109. Trace how each step produces declarations and ownership, and how unresolved constants are retried. Done means the two ordered phases use parallel workers while preserving their distinct retry and discard behavior and improving resolution performance.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.