-
Notifications
You must be signed in to change notification settings - Fork 139
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] PackageFragmentRoot.getRawClasspathEntry() has bad impact on startup performance #3468
Comments
Jay, thanks for taking a look |
Especially calling "Raw" ClasspathEntry would indicate for me it is actually not resolved as there is also eclipse.jdt.core/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java Line 630 in 17fc318
|
Classpath containers are designed to be lazily initialized, so removing getResolvedClasspath shouldn't make a difference. Anyway, let me run some tests/experiments and get back. |
Can you give an example? I just take a look into subclasses of |
OK, my last statement wasn't accurate. What I had in mind was two things: the resolution of the classpath entries itself. getResolvedClasspath() resolves the classpath on demand and no need for it to be invoked when getRawClasspathEntry, which you have called out already. Second, the initialization of the containers themselves is done in a background thread. BTW, I just ran all model tests after removing the code in question and didn't observe any difference in behavior. All tests passed and took about the same amount of time. |
Only if JDT.UI can start before anyone calls a method that enforce an init of the containers. |
By the way if anyone wants to debug it simply do the following:
|
While looking at a problem here I noticed that
PackageFragmentRoot.getRawClasspathEntry()
has a very bad impact on startup performance because it callsproject.getResolvedClasspath()
eclipse.jdt.core/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
Line 616 in 17fc318
this leads to a resolve operation of all classpath containers (that actually should happen in a background thread!) in the main UI thread whenever one has an open Java Editor + Package Explorer open. This even blocks the whole UI startup of eclipse.
This is sadly not the only place where this could happen... but the other places are more UI related.
The text was updated successfully, but these errors were encountered: