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 bottleneck in Ui Thread #907

Open
jukzi opened this issue Feb 5, 2024 · 6 comments
Open

Performance bottleneck in Ui Thread #907

jukzi opened this issue Feb 5, 2024 · 6 comments

Comments

@jukzi
Copy link

jukzi commented Feb 5, 2024

during sampling full build of eclipse platform workspace i saw this:
image
callstack:
image
image

at best UI thread would not perform I/O at all, but at east it should not call super slow java.io.File.getCanonicalPath ()

@jukzi
Copy link
Author

jukzi commented Feb 5, 2024

org.eclipse.lsp4e.LSPEclipseUtils.findResourceFor ()
org.eclipse.lsp4e.outline.SymbolsLabelProvider.getImage () <- maybe cache that image?
org.eclipse.lsp4e.outline.CNFOutlinePage.labelProviderChanged ()

@jukzi
Copy link
Author

jukzi commented Feb 5, 2024

eclipse.buildId=4.31.0.I20240204-1800
java.version=21.0.2
win10

@jukzi
Copy link
Author

jukzi commented Feb 5, 2024

image

@mickaelistria mickaelistria changed the title slow IO access in Ui Thread Performance bottleneck in Ui Thread Feb 6, 2024
@mickaelistria
Copy link
Contributor

findResourceFor is a basic workspace query, that doesn't deal with IO, so I've retitled the issue. Moreover, this particular method cannot be optimized as about all of its execution time is spent in Workspace.findFilesForLocationURI.
This stack most likely come from refreshing the Outline view; the resource is necessary in order to compute markers for the given symbol. However, the findResourceFor operation can probably be cached somehow in the label provider: IIRC, it's a stateful class that lives as long as LSP4E provides an outline, so caching the URI->resolution result in it might work and save most calls to findResourceFor.

@jcompagner
Copy link
Contributor

i have the same thing, i just need to have the outline view closed because with it it is very hard to work inside editors..

@ghentschke
Copy link
Contributor

The next step would be to refactor the org.eclipse.lsp4e.outline.LSSymbolsContentProvider to support partial results as described here
and use something like org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider<E> to support lazy loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants