Skip to content

Look a refreshed resource up once instead of three times - #2919

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:refresh-one-lookup-per-resource
Sep 14, 2026
Merged

vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:refresh-one-lookup-per-resource

Conversation

@vogella

@vogella vogella commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Refreshing a resource walked the element tree from its root three times per directory entry: Container.getChildren fetched the ResourceInfo to decide membership, UnifiedTree.addChildren then asked the member itself whether it is a link, and RefreshLocalVisitor.visit asked for the info again. Each walk does a binary search per path segment and allocates a DataTreeLookup, and the single entry lookup cache in ElementTree is keyed on path identity, so the next member evicts the previous one and every walk is a miss.

Container now hands out the infos it collected anyway, and the visitor reads one info per node, which leaves one walk per entry. The one place that still needs a second lookup is after makeLocal, because that opens the info for modification and may replace the object.

Measured on a workspace with 609 projects and 293953 files, a full refresh that finds nothing to change drops from a median of 2486 ms to 2308 ms over eight runs, and the two ranges do not overlap. Flight recordings over three refreshes each count 1679 garbage collections against 2136, a fifth fewer, with the longest pause unchanged at about 130 ms. This is plain Java with no native code involved, so every platform benefits rather than only the ones whose file system handler has been tuned.

@vogella
vogella force-pushed the refresh-one-lookup-per-resource branch from fdb893f to 36f1775 Compare September 10, 2026 20:10
@vogella
vogella marked this pull request as ready for review September 10, 2026 20:10
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   57m 13s ⏱️ -30s
 4 810 tests ±0   4 788 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 321 runs  ±0  12 168 ✅ ±0  153 💤 ±0  0 ❌ ±0 

Results for commit 76393a1. ± Comparison against base commit c48f2b9.

♻️ This comment has been updated with latest results.

Refreshing walked the element tree from its root three times per directory
entry: once to decide membership, once to ask whether the member is a
link, and once in the visitor. Container now hands out the infos it
collected anyway, and the visitor reads one info per node.

A full workspace refresh over 293953 files drops from a median of 2486 ms
to 2308 ms, with a fifth fewer garbage collections.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the refresh-one-lookup-per-resource branch from 36f1775 to 76393a1 Compare September 14, 2026 08:48
@vogella
vogella merged commit 4d0839d into eclipse-platform:master Sep 14, 2026
18 checks passed
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.

1 participant