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

[performance] EnablementTester.evaluate takes way to long in UI thread #1207

Open
ghentschke opened this issue Feb 5, 2025 · 1 comment · May be fixed by #1208
Open

[performance] EnablementTester.evaluate takes way to long in UI thread #1207

ghentschke opened this issue Feb 5, 2025 · 1 comment · May be fixed by #1208

Comments

@ghentschke
Copy link
Contributor

Due to some performance issues in CDT-LSP I found out that the EnablementTester.evaluate method consumes a lot of time + it gets called very frequently (on ever user typing in the editor):
The profiling while editing a C-File returns me this behavior:

Image

My proposal would be to cash the IResource object found for the URI here, since findResourceFor seems to be the bottleneck:
The resource handle could cashed until its available.

Image

@ghentschke
Copy link
Contributor Author

IMO we could remove the document/resource variable in the context. Users could get the resource from the URI in their testers as well.

@ghentschke ghentschke changed the title [performance] EnablementTester.evaluate takes way to long [performance] EnablementTester.evaluate takes way to long in UI thread Feb 5, 2025
ghentschke added a commit to ghentschke/lsp4e-bachmann-fixes that referenced this issue Feb 5, 2025
Cache resource for URI because each call of
LSPEclipseUtils.findResourceFor(URI) takes ~300 microseconds. And it
gets called a lot of times.

fixes eclipse-lsp4e#1207
ghentschke added a commit to ghentschke/lsp4e-bachmann-fixes that referenced this issue Feb 5, 2025
Cache resource for URI because each call of
LSPEclipseUtils.findResourceFor(URI) takes ~300 microseconds. And it
gets called a lot of times.

fixes eclipse-lsp4e#1207
@ghentschke ghentschke linked a pull request Feb 5, 2025 that will close this issue
ghentschke added a commit to ghentschke/lsp4e-bachmann-fixes that referenced this issue Feb 5, 2025
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 a pull request may close this issue.

1 participant