Skip to content

The system become extremely slow when loading a huge Java workspace #1236

Closed

Description

@Nukepayload2

I have a huge Java workspace that contains 40+ Java projects. Some projects are migrated from Eclipse, some are from IntelliJ. Every project has 200+ Java files in average. This workspace is using Git. When I open this workspace, the system become extremely slow. Even mouse is freezing in every seconds. The task manager lists 100+ "rg.exe" are created by vscode. When the project is loaded (after 2~3 minutes), the system returns to normal and "rg.exe" processes are exited.

I report this performance issue here because the command line parameter of "rg.exe" contains "*.java" .

Environment
  • Operating System:
    Microsoft Windows [Version 10.0.17763.914]
  • JDK version:
    JavaSE-1.6, JavaSE-1.8
  • Visual Studio Code version:
    win32-x64-1.41.1
  • Java extension version:
    0.55.1
Steps To Reproduce
  1. Install extension "Java Extension Pack"
  2. Disable all extensions except "Language support for Java"
  3. Open a workspace that contains 40+ Java projects

[attach a sample project reproducing the error]
I don't know how to create a huge Java workspace quickly.
attach logs
I can't upload the log, because it contains sensitive information. But I can provide a screenshot of process explorer that was taken when the system is slow.
image

Current Result
Expected Result
Additional Informations

Activity

  1. Eskibear commented on Jan 15, 2020

    @Eskibear
    Contributor

    @Nukepayload2 Are you opening a single folder containing 40+ Java projects, or a workspace containing 40+ root folder (e.g. via Add Folder to Workspace...)?

    For the latter, I guess it might be related to https://github.com/redhat-developer/vscode-java/pull/1201/files#diff-45327f86d4438556066de133327f4ca2R863

    For each workspace folder, it searches the whole workspace for *.java files. And below is what the API author suggests to do:

    Use a RelativePattern to restrict the search results to a workspace folder

  2. Nukepayload2 commented on Jan 16, 2020

    @Nukepayload2
    Author

    @Eskibear I'm opening a workspace that containing 40+ root folders. What should I do now? Wait for fix or edit a configuration file?

  3. Eskibear commented on Jan 17, 2020

    @Eskibear
    Contributor

    I tried limiting the search scope to current workspace root, and did a simple test with a workspace containing 6 projects, and it turned out to be a big performance boost.

    Before

    workspace.findFiles("*.java", undefined, 1);
    workspace.findFiles("{src, test}/**/*.java", undefined, 1);

    spring-petclinic, *.java: 1737ms
    spring-boot-deployment-test-wlp, *.java: 1736ms
    spring-boot-deployment-test-wildfly, *.java: 1737ms
    spring-boot-deployment-test-glassfish, *.java: 1738ms
    spring-boot-deployment-test-tomcat, *.java: 1738ms
    spring-boot-deployment-test-tomee, *.java: 1738ms
    
    spring-petclinic, {src,test}/**/*.java: 1872ms
    spring-boot-deployment-test-wlp, {src,test}/**/*.java: 1872ms
    spring-boot-deployment-test-glassfish, {src,test}/**/*.java: 1871ms
    spring-boot-deployment-test-tomcat, {src,test}/**/*.java: 1872ms
    spring-boot-deployment-test-wildfly, {src,test}/**/*.java: 1872ms
    spring-boot-deployment-test-tomee, {src,test}/**/*.java: 1871ms
    

    After limiting search scope with a RelativePattern

    workspace.findFiles(new RelativePattern(rootFolder, "*.java"), undefined, 1);
    workspace.findFiles(new RelativePattern(rootFolder, "{src, test}/**/*.java"), undefined, 1);

    spring-petclinic, *.java: 912ms
    spring-boot-deployment-test-wlp, *.java: 910ms
    spring-boot-deployment-test-wildfly, *.java: 911ms
    spring-boot-deployment-test-glassfish, *.java: 911ms
    spring-boot-deployment-test-tomcat, *.java: 912ms
    spring-boot-deployment-test-tomee, *.java: 911ms
    
    spring-petclinic, {src,test}/**/*.java: 223ms
    spring-boot-deployment-test-wlp, {src,test}/**/*.java: 214ms
    spring-boot-deployment-test-wildfly, {src,test}/**/*.java: 522ms
    spring-boot-deployment-test-glassfish, {src,test}/**/*.java: 223ms
    spring-boot-deployment-test-tomcat, {src,test}/**/*.java: 522ms
    spring-boot-deployment-test-tomee, {src,test}/**/*.java: 522ms
    
    
  4. Bhawika16 commented on May 17, 2024

    @Bhawika16

    Where we have to do this change? @Eskibear @Nukepayload2 @gbraad . Can you please tell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions