-
Notifications
You must be signed in to change notification settings - Fork 419
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
update default vmargs of jdtls to resolve dependencies in parallel #3030
Conversation
Thank you @snjeza for reviewing the code. Now eclipse-jdtls/eclipse.jdt.ls#2563 is merged. @rgrunber @testforstephen Let me know if there's any other concern or objection. If not, please help to merge it, thanks! |
Adding the flag seems fine to me. Just 2 questions :
So are we benefiting from parallel downloading of poms or the new (
|
For 1).
For 2). |
The conclusion is: sample project created from maven-archetype-quickstart (smallest I would say)# maven 3.9.1 + bf
> mvn clean package -Daether.dependencyCollector.impl=bf -Dmaven.repo.local=../m2-bf
[INFO] Total time: 11.330 s
# maven 3.9.1 + df (default)
> mvn clean package -Daether.dependencyCollector.impl=df -Dmaven.repo.local=../m2-df
[INFO] Total time: 18.672 s
# 3.8.7 (default and only impl is df-like)
> mvn clean package -Dmaven.repo.local=../m2-387
[INFO] Total time: 31.795 s
spring-petclinic project (small, or medium at most)# maven 3.9.1 + bf
> mvn clean package -Daether.dependencyCollector.impl=bf -Dmaven.repo.local=../m2-bf
[INFO] Total time: 04:32 min
# maven 3.9.1 + df
> mvn clean package -Daether.dependencyCollector.impl=df -Dmaven.repo.local=../m2-df
[INFO] Total time: 10:14 min
# 3.8.7 (default and only impl is df-like)
> mvn clean package -Dmaven.repo.local=../m2-387
[INFO] Total time: 11:05 min
For even larger projects with more dependencies, I believe |
I'm seeing the same with 3.9.1. eclipse/lemminx (wrapper update) went from ~47s (df) to ~24s (bf). For eclipse/eclipse.jdt.ls (wrapper update) it went from ~4m19s (df) to ~4m4s (bf). Definitely a lot less benefit there, but maybe something to do with the fact that it's using Tycho as well. |
Signed-off-by: Yan Zhang <yanzh@microsoft.com>
From our experience so far, it's reasonable to use |
According to the original PR download pom in parallel, the parallel capability is based on bf mode. It makes sense for me to switch to bf mode for better performance. |
Checked this PR with petclinic on an empty maven repo, build takes 3min with DF, 2min with BF, so definitely a win. |
@Eskibear That's really good. Do you think you could influence Eclipse m2e or even Maven in making this strategy the default? that would be 1 less thing to manage on vscode-java and a benefit for more clients at once. |
Yes, I think so. As long as maven-resolver makes In fact, it's already tracked in MRESOLVER-324. But AFAIK years ago maven-resolver maintainers prefer stability over performance, so I don't expect much that would happen soon. My initial strategy was:
If you want m2e related clients get dogfood the performance boost first, we can create an issue in m2e to track this, and make it happen. |
I would be in favour of seeing this done by default in m2e-core. If we can't make it the default there, maybe we can get some kind of API so we can set it as the default in JDT-LS (or just set the system property really early in JDT-LS startup ?). |
@Eskibear Thanks for the link to MRESOLVER-324 and for sharing your plan of action, I also found eclipse-m2e/m2e-core#1169 . I think the metrics you've reported here would weigh a lot in allowing the default to change. And even if they don't, they're extremely valuabledata to share.
That would be great, I think m2e is more pragmatic and open to adopt more performant constructs unless they're know to be fragile (which doesn't really seem to be the case here) |
I think I've found a regression here, though I suspect not a lot of people are running into it. Still worth investigating. Make sure you have development version of vscode-java (or pre-release), and Simply import eclipse/eclipse.jdt.ls . The first time, when certain dependencies need to be update / workspace refresh, it will work as expected. In particular you'll notice the diagnostics get published (icons on bottom left), and there's a period where the build status icon is still spinning as it finishes off the build. It will eventually complete, in ~1min for me. Reload the window / close + re-open the child instance from the extension host, and while it seems to get past ServiceReady (the import notification disappears), the diagnostics never get published, and the build status icon is left spinning. When checking the client/server communication, there isn't much being reported, which should be the case if it were just taking longer to build. As far as I can tell it just hangs in this incomplete state. Build status shows :
If I switch (back) to diff --git a/src/javaServerStarter.ts b/src/javaServerStarter.ts
index 34ba23d..e86166d 100644
--- a/src/javaServerStarter.ts
+++ b/src/javaServerStarter.ts
@@ -32,7 +32,7 @@ export const HEAP_DUMP = '-XX:+HeapDumpOnOutOfMemoryError';
* See: https://github.com/apache/maven-resolver/blob/maven-resolver-1.9.7/src/site/markdown/configuration.md
*/
const DEPENDENCY_COLLECTOR_IMPL= '-Daether.dependencyCollector.impl=';
-const DEPENDENCY_COLLECTOR_IMPL_BF= 'bf';
+const DEPENDENCY_COLLECTOR_IMPL_BF= 'df';
export function prepareExecutable(requirements: RequirementsData, workspacePath, javaConfig, context: ExtensionContext, isSyntaxServer: boolean): Executable {
const executable: Executable = Object.create(null); |
I tried a couple of times (including on a new machine), but could not reproduce it.
It seems to be unrelated at a glance. I do observe that for an arbitrary maven project occasionally it gets stuck on a background task and never finishs, but that's usually back to normal after a reloading. Not sure if that's related. @rgrunber What if you switch back to @testforstephen @jdneo @CsCherrYY Are you observing the same issue given you are working on jdtls project everyday? |
Recently I encountered this issue once, and reload window fixed it for me. |
it requires eclipse-jdtls/eclipse.jdt.ls#2563