Add parallelism to the resolution phase
Nobody has claimed this yet.
- 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:
- Resolving constant names. This both resolves constants and creates declarations with ownership
- Handling non-constant definitions. This only creates declarations with ownership
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
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 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