Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[optimization] avoid writing caches multiple times on file delete events #1118

Closed
martinlippert opened this issue Oct 5, 2023 · 0 comments
Closed
Assignees
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: performance theme: spring index & symbols type: enhancement

Comments

@martinlippert
Copy link
Member

The current cache implementation causes the cache files to be written way too often, especially on file delete events.

On file delete events, the SpringSymbolIndex calls every indexer (java, factories, xml) to react to those file delete events. Every indexer then runs a loop through all deleted files and removes that deletes file from the cache individually, sometimes the cache remove file method is called multiple times for different types (like symbols, bean index, etc.). On every call, the cache writes the updated cache to disc.

We should improve this implementation:

  • the cache should write the cache to disc only if something has changed (the removed file was actually part of the cache store)
  • the indexer should call one method for all files (a bulk delete method) on the cache implementation to remove all the files from the cache store and then store the cache only once. This has to happen for every type (beans, symbols, etc.), but that should be fine, since there are separate cache files for those different types that all need to be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: performance theme: spring index & symbols type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant