Skip to content

Compute Quick Access filter state once per filter - #4481

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/quickaccess-matching-allocations
Oct 15, 2026
Merged

vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/quickaccess-matching-allocations

Conversation

@vogella

@vogella vogella commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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.

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 🤖
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   1h 6m 29s ⏱️ + 13m 18s
 8 433 tests ±0   8 191 ✅ ±0  242 💤 ±0  0 ❌ ±0 
21 174 runs  ±0  20 491 ✅ ±0  683 💤 ±0  0 ❌ ±0 

Results for commit 0b6a3e2. ± Comparison against base commit 185207f.

@vogella
vogella requested a balanced review from Copilot October 15, 2026 05:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@vogella
vogella merged commit bab189a into eclipse-platform:master Oct 15, 2026
18 checks passed
@vogella
vogella deleted the lv/quickaccess-matching-allocations branch October 15, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants