Repository navigation
perf: deduplicate found expressions with an IndexSet - #26474
Merged
jayzhan211 merged 2 commits intoOct 26, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26474 +/- ##
==========================================
- Coverage 82.90% 82.89% -0.01%
==========================================
Files 1154 1154
Lines 457654 457680 +26
Branches 457654 457680 +26
==========================================
+ Hits 379398 379412 +14
- Misses 55252 55261 +9
- Partials 23004 23007 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jayzhan211
approved these changes
Oct 23, 2026
Comment on lines
+879
to
+881
| let mut found = IndexSet::new(); | ||
| collect_exprs_in_expr(expr, test_fn, &mut found); | ||
| found.into_iter().collect() |
Contributor
There was a problem hiding this comment.
nit: this can just delegate to find_exprs_in_exprs, which leaves one place that builds the set:
- let mut found = IndexSet::new();
- collect_exprs_in_expr(expr, test_fn, &mut found);
- found.into_iter().collect()
+ find_exprs_in_exprs(std::iter::once(expr), test_fn)
Contributor
|
This PR appears to be waiting on the author to respond to reviewer feedback so marking as draft. Please mark ready to review when it is ready for another look |
alamb
marked this pull request as draft
October 24, 2026 10:04
Braedon-Wooding-Displayr
force-pushed
the
perf/find-exprs-dedup-hash
branch
from
October 25, 2026 23:51
9d76a7d to
93c0cbd
Compare
Braedon-Wooding-Displayr
marked this pull request as ready for review
October 25, 2026 23:52
Contributor
Author
|
Sorry! Australian timezones mean that it sits over weekends sometimes! I've just fixed and rebase + pushed, should be ready for merge now @alamb |
Contributor
|
Thanks @Braedon-Wooding-Displayr ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've got a few fixes to upstream so just starting with small ones.
Which issue does this PR close?
Rationale for this change
find_exprs_in_exprsandfind_exprs_in_exprdeduplicate withVec::contains, which is quadratic in the number of distinct matches. On 20,000 distinct aggregatesfind_aggregate_exprstakes 932 ms; with this change it takes 2.8 ms (release build, see the issue for the full table).What changes are included in this PR?
Both functions now collect into a single index set.
Are there any user-facing changes?
No