-
Notifications
You must be signed in to change notification settings - Fork 420
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
VSCode reloads Java projects on each startup which takes a very long time #2643
Comments
@xxc-zsz What OS are you using? Do you use maven, gradle? |
Hi @snjeza Maven project |
I found #2577 (comment) can solve my problem. |
@xxc-zsz Did you still observe the problem with the latest pre-release? There are several fixes regarding perf done recently. You can click this button to turn on the pre-release channel |
I have same problem here... I run vscode server in docker container. It took more than 5 minutes for loading java project... System used: |
I am experiencing the same problem running in a devcontainer. The project does not even contain much Java, it is mostly used to build things with maven. Host: MacOs (aarch64) My initial thought was, that file I/O on docker on macOs is not the fastest. This can be improved by making the used folder a volume. Can someone tell me, what folder this extension puts its index in (assuming the indexing of the project is the slow part)? I tried the pre-release version, did not noticeably differ wrt this issue. The task seems stuck on one item when reading the saved build state. Once that is done, it finishes almost instantly.
|
I'm facing the same problem and switched back to eclipse. Any update on this issue? |
In eclipse, it take less than a minute to load several huge java projects and you are ready to run the tests. But, in vscode, you have to wait until you see the thumbs up icon in the status bar, which can take between 2 to 5 minutes for one maven project with 5 relatively large modules. During the loading process, nothing works like intelisens, running tests... etc.. You have to sit and wait... |
@GourabIX @tarekahf Could you, please, provide a project example? |
I am facing the same problem, any update regarding this issue? |
@jcgaming-official You can try to set
to your settings.json. |
Try this project to reproduce the issue: https://github.com/javalite/jar-explorer Everytime you open the project, open a Java source file and watch how the code is being compiled. This is a small project so compilation might finish quickly. But, it will always compile and you can click on view details to see the progress in the terminal window. Let me if you need more information... |
facing the same issue, at first vs code opened projects very fast like 1 or 2 mins, don't know what happened after updating in oct/ nov in 2023, every time i open java project in vscode, it is taking like 20 mins to load all the projects. |
You mean Oct/Nov 2022? |
my bad, yes that is 2022 |
I am still facing this issue on Oct / Nov 2023 on Fedora. My Java spring boot projects are cleaned on startup causing protobuf generated sources to be not present in maven submodule, which then shows redlines all over the place on other submodules which depend on it. |
I'm always facing the same problem. It takes about 7 minutes to load and run the unit test in VS code. In eclipse, for the same project, it takes 40 seconds. |
@overtomanu @tarekahf Could you, please, provide a project example? |
I already provided one, see my previous post above. I'll try to make a screen recording for both. |
@snjeza I have opened around 8 to 10 work related projects. These projects are spring boot projects with some of them having proto files, nothing out of the ordinary. I will try to get sample project's to reproduce this issue when i get time. |
I also have problems here please improve this it takes 35 min each time to load the project, and I need to use lightweight mode but then I cannot debug it's so annoying |
I found a solution and it us the best. To fix this issue, just switch your OS into Linux. Yes I am using that now and it's open smoothly |
I'm facing the same problem. I have about 70 java projects and it's taking more than 35 minutes. Not sure why it has to reload everything. It should just be reloading the deltas. |
@cervantesandres Could you try VS Code Pre-Release? It includes the fix for #3637 |
@snjeza Could you clarify what you're referring to by "VS Code Pre-Release"? |
@cervantesandres Could you try the steps from eclipse-jdtls/eclipse.jdt.ls#3150 (comment)? Step 6 (building) is the same, but step 7 (reloading) has improved significantly. |
@snjeza to clarify, you want me to try these 7 steps? |
Yes. You should use your project instead of quarkus-langchain4j |
@snjeza I followed the steps you recommended, yet I'm still experiencing no improvement in time efficiency. My workspace comprises 70 repositories, each of which is a Java project. |
@snjeza I'd appreciate the opportunity to discuss what I'm seeing over a call. Could you please let me know your availability so we can arrange a suitable time? |
@cervantesandres You have to wait for the build to finish in step 6. |
@snjeza I've revised the steps, and now the process takes between 8 to 12 minutes. While it's an improvement, waiting for the Java reload to complete still feels too long. |
@cervantesandres Could you provide your project? You can send it to my email snjezana.peco@redhat.com |
@snjeza Regrettably, I'm unable to share it as it's proprietary code. Let me provide some context: I manage a workspace in Visual Studio Code comprising over 70 Git Java web repositories. These projects are unrelated to each other. However, in VSCode, they all share the same reference libraries. In Eclipse, each web project has its own reference libraries. This setup might be causing VSCode to perceive them as a single project, necessitating a refresh for every change. |
@cervantesandres What projects are you using: Eclipse, Maven, Gradle? |
@snjeza Initially, all projects were developed in Eclipse without using build automation tools like Maven or Gradle. We are now transitioning to VSCODE. |
Eclipse projects should work fine. |
@snjeza I identified the problem: when I imported the folder containing all my Java programs into VSCode, it treated it as a single project. To resolve this, I created a new workspace and added each folder individually. Now, they are treated as separate projects within a single workspace. In Eclipse, you can refer to other project within the workspace. Is there an option like that in VSCode? I have a common project that is reference in every other project. |
I was hit by the slowness issue too, it could take 10 minutes each time. |
No kidding! I must give it a shot! |
The release version of the extension pack for Java (v0.27.0) resolves this issue. Projects don't get re-compiled every time, and it takes around 25s for 4 complex Java Spring Boot projects to become ready. First time compilation has also become noticeably faster. |
I'm going to close this issue, given that the past few commenters have indicated that recent versions of the extension seem to have fixed this. The following issues, which resulted in fixes, may have also fixed this one :
Feel free to request re-opening if not the case, but it might be better to file a new issue. |
I am in the process of switching from Eclipse to VSCode for Java Development - so far, I have been able to setup a workspace folder with all my Java projects in it and all works fine.
However, every time I restart VSCode, all projects are rebuilding (showing me "Opening Java Projects: check details") which takes a very long time (about 5 minutes) - in comparision, when I am re-opening my Eclipse workspace with the same amount of projects, it only takes ~30 seconds for everything to be ready. Is there something I am doing wrong or can't VSCode "remember" Java projects as good as Eclipse?
The text was updated successfully, but these errors were encountered: