Repository navigation
perf: add a cache adapter which adapts only its resource - #1631
Merged
rubenporras merged 1 commit intoNov 12, 2026
Merged
Conversation
Xtext's OnChangeEvictingCache.CacheAdapter is an EContentAdapter: the first cache access on a resource attaches it to every object in the resource, and attaching it calls getContents(), which may load the resource or install its derived state. Any change of any object then clears the whole resource cache. ResourceOnlyCacheAdapter adapts only the resource. It is cleared explicitly and on changes of the resource itself (root contents, load state, URI), not on changes of its objects. Since OnChangeEvictingCache uses the cache adapter already on a resource, it must be installed before the first cache access; IndexingInstaller installs it on the resources added to a resource set while it is indexing. Nothing in DDK uses it, so it only takes effect where a client adds the installer. ResourceCache.getStatistics reads the fields from CacheAdapter so that it also works for subclasses. Assisted-by: GitHub Copilot (Claude Opus 5.5)
rubenporras
force-pushed
the
perf/resource-only-cache-adapter
branch
from
November 12, 2026 16:49
7201b70 to
64da624
Compare
rubenporras
enabled auto-merge
November 12, 2026 16:49
joaodinissf
approved these changes
Nov 12, 2026
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.
Xtext's OnChangeEvictingCache.CacheAdapter is an EContentAdapter: the first cache access on a resource attaches it to every object in the resource, and attaching it calls getContents(), which may load the resource or install its derived state. Any change of any object then clears the whole resource cache.
ResourceOnlyCacheAdapter adapts only the resource. It is cleared explicitly and on changes of the resource itself (root contents, load state, URI), not on changes of its objects. Since OnChangeEvictingCache uses the cache adapter already on a resource, it must be installed before the first cache access; IndexingInstaller installs it on the resources added to a resource set while it is indexing. Nothing in DDK uses it, so it only takes effect where a client adds the installer.
ResourceCache.getStatistics reads the fields from CacheAdapter so that it also works for subclasses.
Assisted-by: GitHub Copilot (Claude Opus 5.5)