Closed Carson-yy closed 1 year ago
I'm also facing the same issue. Where if you Java project is monolithic with large files or a single Java file containing more than 400 line of code everything becomes slow
@yaegar @parthasaradhie could you attach a project example reproducing the issue?
I can't share the logs and project details because of company security policy. But few details like It's spring boot project with more than 200 Java classes and if the file has more than 400 lines then the content assist and cmd+click on method is slow
Other than that if file is small then it's almost smooth
Mac os Intel chip Java server is running default Java 17
I can't share the logs and project details because of company security policy. But few details like It's spring boot project with more than 200 Java classes and if the file has more than 400 lines then the content assist and cmd+click on method is slow
Other than that if file is small then it's almost smooth
Mac os Intel chip Java server is running default Java 17
me too
I can't share the logs and project details because of company security policy. But few details like It's spring boot project with more than 200 Java classes and if the file has more than 400 lines then the content assist and cmd+click on method is slow Other than that if file is small then it's almost smooth
Could you provide more details? How long does it take? Could you show your settings.json? Do you have some other extensions? Do you use lombok?
Here is video recording for above scenario.
Attaching the detailed log (class names and file names are obscured) https://gist.github.com/parthasaradhie/34bca17c57e45e39e5a0bb35621ed9f6
@parthasaradhie Which VS Code version are you using? Could you show your server log?
Vscode Version: 1.76.0 Language Support for Java(TM) by Red Hat: 1.15 Debugger for Java: v0.49.2023022723 IntelliCode: v1.2.30 Maven for Java: v0.40.4 Project Manager for Java: v0.21.1
Also one more point is if i run the springboot application in Debug mode. the content assist and all other functionalities will become even slower of response time of more than 10-15 seconds
Here are the server logs: https://gist.github.com/parthasaradhie/79c82e3a9dbd10c21c64d9b24d38f395
@parthasaradhie @yaegar Could you test VS Code 1.16.3?
@snjeza Good work Few Observation after testing:
Let me know if anything else needed to test.
Lombok is completely broken not at all working
@parthasaradhie You may want to take a look at https://github.com/redhat-developer/vscode-java/issues/2983#issuecomment-1458753354
@snjeza I have enabled the Lombok and getting the same issue as above with 1.16.3 It decreased the performance
@parthasaradhie I can't reproduce the issue.
You can enable lombok with 1.16.3. Could you show your settings.json?
@snjeza I have successfully enabled the lombok. Its working as expected. But The content assist, method reference navigation performances has degraded a lot 1.16.3 doesnt improve any performance, show similar effects as shown in the above video of mine
But one thing I noted is if i disable the lombok everything is working smooth.
` "java.configuration.maven.notCoveredPluginExecutionSeverity": "ignore",
"java.autobuild.enabled": false,
"java.jdt.ls.lombokSupport.enabled": false,
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:MetaspaceSize=300M -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx5G -Xms2G -Xlog:disable -XX:-HeapDumpOnOutOfMemoryError -javaagent:{{extensionpath}}/redhat.java-1.15.0-darwin-x64/lombok/lombok-1.18.24.jar", `
@parthasaradhie could you try to set
"java.references.includeAccessors": false,
"java.implementationsCodeLens.enabled": false,
"java.referencesCodeLens.enabled": false,
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:MetaspaceSize=300M -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx5G -Xms2G -Xlog:disable -XX:-HeapDumpOnOutOfMemoryError -javaagent:<path_to_lombok-1.18.27.jar.jar",
could you show your pom.xml or build.gradle?
@snjeza I cant provide the pom.xml And I can confirm we are not doing much processing or have plugins installed only docker (runs at delploy time) and de-lombok(runs at compile time)
Got this below error one time :
[Error - 01:22:16] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 01:22:16] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 01:22:16] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 01:22:18] Stopping server timed out
[Error - 01:22:18] Stopping server failed
Error: Stopping the server timed out
at //extensions/redhat.java-1.16.3/dist/extension.js:2:918472
[Error - 01:22:18] Stopping server failed
Error: Stopping the server timed out
at //extensions/redhat.java-1.16.3/dist/extension.js:2:918472
[Error - 01:22:18] Stopping server failed
Error: Stopping the server timed out
at /extensions/redhat.java-1.16.3/dist/extension.js:2:918472
WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.vector
[Error - 01:22:31] Client Language Support for Java: connection to server is erroring. Shutting down server.
[Error - 01:22:31] Client Language Support for Java: connection to server is erroring. Shutting down server.
used your lombok 1.18.27 in settings.xml and pom.xml(1.18.26)
It is fine.
cmd+space is still slow after "." like (test.(cmd+spce)) but results are getting <6 sec
@parthasaradhie Could you describe the test
class?
@snjeza
the test class has 1500 lines of code with almost 70 imports (56 are lombok classes) use spring boot @autowired for dependency injection approximately 30 methods are there (16 are public) our project uses close to 150 dependencies using maven
@parthasaradhie Could you show an example of your lombok class?
Could you try to set the following properties:
"java.references.includeAccessors": false,
"java.inlayHints.parameterNames.enabled": "none",
"java.implementationsCodeLens.enabled": false,
"java.referencesCodeLens.enabled": false,
"java.configuration.maven.defaultMojoExecutionAction": "ignore",
"java.completion.postfix.enabled": false,
"editor.snippetSuggestions": "none",
"java.completion.matchCase": "off",
"java.completion.maxResults": 100,
@snjeza
@parthasaradhie Could you check https://github.com/snjeza/vscode-test/raw/master/java-1.16.4.vsix ? You can check the issue with or without the properties from https://github.com/redhat-developer/vscode-java/issues/2982#issuecomment-1465313123
@snjeza
My Observations for above build:
@parthasaradhie Could you check https://github.com/snjeza/vscode-test/raw/master/java-1.16.5.vsix
- The error Red squiggly line is still laggay and taking 3-5 sec to respond with and without that settings.
I can't reproduce this. Could you provide more details?
@snjeza
Attaching a video for your reference . here you can observer the red line even to show that there is a error takes 5sec and to disappear that red line is very laggy and the file is > 1500 lines (used the above config you have provided and using 1.16.5 provided above) attaching logs for the same : https://gist.github.com/parthasaradhie/c3c6a17cff8129c6a457cec55636a8e1
here you can observer the red line even to show that there is a error takes 5sec and to disappear that red line is very laggy and the file is > 1500 lines
@parthasaradhie Do you mean on a red line in the editor?
I have checked your log and completion lasts <= 1116ms (1.1second)
@snjeza
Exactly I'm confused after seeing logs, in the video it's clearly seen its defenetly taking more than 4 seconds. I think either there might be issue in log time calculation or if server is really responding in 1.1 Sec the why is it taking 4 sec to reflect in the UI
I tried with my colleague Mac machine the behaviour is still the same
Exactly I'm confused after seeing logs, in the video it's clearly seen its defenetly taking more than 4 seconds.
@parthasaradhie Does it only happen the first time?
@snjeza it happens all the time but only in these kind of large files >500 line or lot of Lombok classes imported like that
@parthasaradhie Does 1.16.5 improves CA compared to pre release
or 1.15?
... lot of Lombok classes imported like that
I will try to simulate this case. Which lombok annotations are you using?
@snjeza Every pojo class is created with Lombok in this repo Every pojo has @data @NoargConstructor @Allargconstructor @builder
Exactly I'm confused after seeing logs, in the video it's clearly seen its defenetly taking more than 4 seconds.
@parthasaradhie Could you, please, add
"java.jdt.ls.vmargs": "-Dlog.level=ALL -Djdt.ls.debug=false <your_vmargs>",
and repeat your screencast and/or log?
@snjeza
Sharing the video for the same. Here there is a record where response time is 3.9 sec also sharing logs for the same. One observation I found here is LS is processing all the opened files in the editor irrespective of the file I'm editing.
Test2.java is exact replica of Test.java Like in the below Video you can see Two files Test.java, Test2.java opened in VScode even though i'm editing only Test.java in logs I can see LS is processing the Two files. See if this helps in improving it.
If I close the Test2.java LS is not processing the Test2.java but only the file that im editing(Test.java).
https://gist.github.com/parthasaradhie/f74fa76ee00233104019c906b1135b25
Sharing the video for the same. Here there is a record where response time is 3.9 sec also sharing logs for the same.
Could you, please, check how it works without lombok?
One observation I found here is LS is processing all the opened files in the editor irrespective of the file I'm editing.
We have to process all opened files. It is possible that editing Test.java fixes or introduces an error in Test2.java. Steps to reproduce:
test2()
method in Test.java new Test().test()
in Test2.java;The method test is undefined for the type Test
error.test2
to test
; you don't need to save anything
it will fix The method test is undefined for the type Test
in Test2.java@snjeza
Could you, please, check how it works without lombok?
I have repetead the same test on the same project DE-lomboked (using delomboked plugin) Observations
https://gist.github.com/parthasaradhie/eec24a25fb187f7c50e8c974a7545564
I feel because of some lombok processing its getting lagged.
You are right. Lombok injects its own ast parser - https://github.com/projectlombok/lombok/blob/master/src/core/lombok/eclipse/EclipseAST.java#L62 Are you using lombok.config?
Are you using lombok.config?
Nope this project desnt uses any custom config
@parthasaradhie Could you try to add
"java.jdt.ls.vmargs": "-Dlombok.disableConfig=true -Dlog.level=ALL -Djdt.ls.debug=false <your_vmargs>",
@snjeza its still the same content assist is lot faster but error red line and method (cmd+click) is slower.
...but error red line...
public class Test { private void Test() {
}
}
@parthasaradhie Could you try to replace `private void Test() ` with `private void test()`?
... method (cmd+click) is slower
It should be faster with -Dlombok.disableConfig=true
especially if your packages have many segments/directories.
@snjeza your right, I have been using your extension for a while with above settings, content assist ,method navigation and Lombok processing works faster than the base extension version. But one notable difference is it not as fast as intellij editor but its faster to an acceptable usage. Appreciate your hardwork 9n this Basically I want to replace intellij with vscode here
Definitely lombok related (see bottom).
@parthasaradhie @rgrunber Could you check https://github.com/snjeza/vscode-test/raw/master/java-1.17.3.vsix
settings.json
"java.jdt.ls.vmargs": "-Dlombok.disableConfig=true -Dlog.level=ALL -Djdt.ls.debug=false -javaagent:/path_to_lombok-1.18.27.jar<your_vmargs>",
"java.jdt.ls.lombokSupport.enabled": false,
Is there anything left to do here or can this be closed due to https://github.com/eclipse/eclipse.jdt.ls/pull/2535 & https://github.com/eclipse/eclipse.jdt.ls/pull/2574 .
d0bc8853 Building [Done] 85a443d4 Validate documents [Done] 99449c46 Building: 85% Refreshing '/cloudeasy-cloudmanage'. [854/1000]
Many project files, frequent Building, smart code hints and slow jumps!!!(较大项目开发过程中,编写代码过程中频繁编译,经常出现代码提示慢,跳转实现慢甚至语法检测都会延迟好几秒才会完成!)