Skip to content

Skip filter evaluation for projects without resource filters - #2884

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:filter-children-early-out
Open

Skip filter evaluation for projects without resource filters#2884
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:filter-children-early-out

Conversation

@vogella

@vogella vogella commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Resource.filterChildren runs for every directory scanned by a refresh or an isSynchronized walk. Even for a project with no resource filters at all, it allocated two lists and walked the project-relative path to the project root, allocating an IPath and taking a synchronized getFilter call per segment, only to discard everything.

This returns early when the project description holds no filters. ProjectDescription.getFilters() is null exactly in that case, so the check is precise rather than a heuristic, and isFilteredWithException already guards the same way. The gain shows up in the auto-refresh polling path, which walks whole projects continuously on Linux. FilteredResourceTest passes unchanged.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   57m 38s ⏱️ +5s
 4 765 tests ±0   4 743 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 186 runs  ±0  12 033 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 1165545. ± Comparison against base commit b6dcc49.

♻️ This comment has been updated with latest results.

@vogella
vogella force-pushed the filter-children-early-out branch 2 times, most recently from 95d1488 to 6ce8130 Compare September 1, 2026 07:04
@vogella

vogella commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Wrong click, will remove the merge commit

@vogella
vogella force-pushed the filter-children-early-out branch from 6767038 to d23e386 Compare September 1, 2026 09:55
@vogella
vogella requested a balanced review from Copilot September 1, 2026 16: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.

Pull request overview

Optimizes resource-tree scans by bypassing filter evaluation when a project has no resource filters.

Changes:

  • Adds an early return based on the project description’s filter map.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Resource.filterChildren runs for every directory scanned by a refresh or
an isSynchronized walk. Even for a project without any resource filter it
allocated two lists and walked the project-relative path up to the root,
allocating an IPath and taking a synchronized getFilter call per segment.
Return early when the project description holds no filters, which cuts
this garbage from the auto-refresh polling path.

ProjectDescription.getFilters is now synchronized like the other filter
accessors, so the hot path no longer reads the field outside the monitor
those accessors use. For every folder below the project root this is
still fewer monitor acquisitions than before, because the loop it
replaces took one per path segment.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the filter-children-early-out branch from d23e386 to 1165545 Compare September 2, 2026 09:33
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