java-language-server icon indicating copy to clipboard operation
java-language-server copied to clipboard

Using in vim with huge java projects

Open alepekhin opened this issue 1 year ago • 3 comments

I use vim-lsc plugin and this language server built from sources. It works fine with small and average size Java projects. With huge projects, about several thousands Java files, it also works but uses 500% - 600% of CPU for a long time that I don't like. It turns on the fan on my computer. How can I make it works slowly? Currently I have to switch off LSP support at all for that projects

alepekhin avatar May 15 '25 16:05 alepekhin

IMO this language server rather works better for larger projects. I use the language server for a Java project with 20k+ source files and it's the most performant server for me. It takes up to ~20 seconds to publish diagnostics for the first file opened, but subsequent file opens are usually almost instant.

I'm using VSCode and I tried two other popular Java language servers available for VSCode (RedHat, Oracle), but they were significantly slower than this language server; they're based on existing IDE cores (RedHat: Eclipse JDT, Oracle: NetBeans) and they do not start serving language client requests until they finish indexing all source code in the repository, which takes 30+ minutes for me.

How long does it take in your project to publish diagnostics for the first opened file, and subsuquent files? If the numbers are too different from mine, you might want to check if you compiled the language server correctly.

nya3jp avatar May 16 '25 00:05 nya3jp

Thank you for response The project I tried is https://github.com/apache/nifi It contains 22 submodules with total number of Java files 8552 If I open a submodule, for example nifi-commons which contains 881 Java file then to get completion takes about 20 sec If I start from the root, getting completion takes 1 min 50 sec Completion after opening the second file is almost instant, less 1 sec So, I think now, two minutes for such project is not bad. Server was compiled as usual as mvn clean package all tests passed

alepekhin avatar May 16 '25 09:05 alepekhin

Reopen the issue as it is related to https://github.com/georgewfraser/java-language-server/pull/319

alepekhin avatar May 25 '25 08:05 alepekhin