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
Simplify PDE classpath resolving #2671
Conversation
I've noticed that starting SpotBugs analysis in the IDE where workspace contains lot of plugin project takes sometimes longer as the analysis itself. Turned out, we do lot of duplicated work resolving plugins classpath, while Eclipse already resolved almost everything for us via JavaRuntime.computeDefaultRuntimeClassPath(). Just removing lot of code here allows reduce startup times for spotbugs analysis, especially if running analysis on ~100 plugins in parallel.
LGTM and makes sense. Thanks! |
@iloveeclipse Can you add an entry to the change log and send another PR so we don't lose track of this change? |
@hazendaz : you were a bit too fast, and I was not careful enough to declare this PR as a draft. I've did some real life testing today on my two major workspaces (one including most of Eclipse SDK and another one including our ~200 product bundles) and found some corner cases where we still need to perform some more work to avoid "blabla class not found" errors, but fortunately this work does not re-introduce reported issue here, so it would still fix the long startup time. I will push a new PR soon and along with that also updated README. |
Here is it: #2673 |
The fix spotbugs#2671 removed a bit more code as needed to fix slow PDE classpath resolving of the PDE project classpath, resulting in "The following classes needed for SpotBugs analysis on project XYZ were missing" warnings reported for few plugin projects. This is a corner case, but not nice. After a bit more evaluation, turned out, we do not need to manually (recursively) resolve plugins classpath looking in each dependent *workspace* PDE bundle (which caused repetitive classpath resolving and huge overhead), but we still need to add all libraries from all *bundle dependencies* (recursive), even if they do not contribute to the project runtime classpath (OSGI does that behind the scenes, so PDE doesn't include them by default). So this patch restores some of that PDE classpath extension logic removed via spotbugs#2671 (but still solves original issue reported in spotbugs#2671). See spotbugs#2671
The fix #2671 removed a bit more code as needed to fix slow PDE classpath resolving of the PDE project classpath, resulting in "The following classes needed for SpotBugs analysis on project XYZ were missing" warnings reported for few plugin projects. This is a corner case, but not nice. After a bit more evaluation, turned out, we do not need to manually (recursively) resolve plugins classpath looking in each dependent *workspace* PDE bundle (which caused repetitive classpath resolving and huge overhead), but we still need to add all libraries from all *bundle dependencies* (recursive), even if they do not contribute to the project runtime classpath (OSGI does that behind the scenes, so PDE doesn't include them by default). So this patch restores some of that PDE classpath extension logic removed via #2671 (but still solves original issue reported in #2671). See #2671
I've noticed that starting SpotBugs analysis in the IDE where workspace contains lot of plugin project takes sometimes longer as the analysis itself.
Turned out, we do lot of duplicated work resolving plugins classpath, while Eclipse already resolved almost everything for us via JavaRuntime.computeDefaultRuntimeClassPath().
Just removing lot of code here allows reduce startup times for spotbugs analysis, especially if running analysis on ~100 plugins in parallel.
CHANGELOG.md
if you have changed SpotBugs code