Compiler set intersections always iterate the first input
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 251k
- Forks
- 51.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 53
Description
React version
Current main (2dc7da790d63).
Steps to reproduce
- Call the compiler utility
Set_intersectwith a large first set, another large set, and a very small later set. - Count membership checks in each remaining input.
Current behavior
The utility checks remaining sets in their supplied order for every element of the first set. Its live compiler use intersects predecessor assumedNonNullObjects; when an early large predecessor is followed by a tiny one, most impossible candidates still incur checks against the larger set before the small set rejects them.
Expected behavior
Keep iterating the first set so result insertion order is stable, but probe the smallest remaining set first. Non-members then short-circuit before larger-set checks without changing intersection values or order.
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 by locating the compiler utility Set_intersect and its live use with assumedNonNullObjects. Exercise the case with a large first set and a tiny later set, then verify that the smallest remaining set is probed first while intersection values and insertion order stay unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100