Repository navigation
Compute Quick Access filter state once per filter - #4481
Merged
vogella merged 1 commit intoOct 15, 2026
Merged
Conversation
The matcher runs for every element on every keystroke, yet it recompiled the "[\s*?]" regex and re-lowercased the filter to build the scoring needle for each matching element, and squashed repeated stars with replaceAll for each element just to look up its cached wildcard pattern. It also lower-cased the same labels more than once per element. The needle is now derived once per filter and cached on the matcher, the wildcard pattern cache is keyed on the raw filter, the constant regexes are precompiled, and doMatch lower-cases each label once. The public static methods keep their signatures and results. Assisted-by: multiple AI agents and layers of automated tooling 🤖
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused refactor preserves matching and scoring behavior, with no blocking issues identified; tests were not executed.
0 open findings
What changed in this PR
Optimizes Quick Access filtering by reusing filter-derived state and reducing repeated string processing while preserving public method signatures and matching results.
Changes:
- Precompiles constant regexes and separates scoring-needle preparation from scoring.
- Caches the scoring needle and reuses lower-cased labels.
| File | Description |
|---|---|
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/quickaccess/QuickAccessMatching.java | Adds precompiled patterns and helpers for prepared inputs. |
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/quickaccess/QuickAccessMatcher.java | Caches filter state and reduces repeated label conversions. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Quick Access matches every element against the filter on every keystroke, but for each matching element it recompiled the "[\s*?]" regex and lower-cased the filter again to build the scoring needle, and it squashed repeated stars with replaceAll only to look up the cached wildcard pattern. Labels were also lower-cased more than once per element. The needle is now computed once per filter and cached on the matcher, the wildcard pattern cache is keyed on the raw filter, the constant regular expressions are precompiled, and each label is lower-cased once. This takes repeated regex compilation and string copies out of the per-element loop, while the public static methods of QuickAccessMatching keep their signatures and results.