question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Very slow update/refresh with Gradle multi project including non Java project with large number of files

See original GitHub issue

Hi,

I’m using a multi project build with a Spring Boot backend and an Angular frontend. The Gradle build is used to create a jar for the frontend that serves as a dependency for the Spring Boot project. Each project has its own build.gradle file. No issues there.

The problem is that the Java Language Server spends a large of amount of time (~15 minutes) updating and refreshing the root project. It seems that this is due to the large amount of files in the frontend project (node_modules) because removing this directory considerably improves the refresh time. Also, completely removing the frontend project makes everything work quickly as expected.

The refresh is slow even when the frontend project is not referenced at all in the Gradle build (not declared as a subproject and not referenced as a dependency).

Using the Gradle CLI, everything works normally. Configuration is fast.

I tried to remove the build.gradle files from the frontend project and configure it from the root project’s build.gradle but same result.

Is the Language Server indexing or browsing all the files from the frontend project even though it is not a Java project? Is there any way to make it ignore files or directories or non Java projects?

Thanks for your pointers.

Environment
  • Operating System: Windows 10 Pro
  • JDK version: openjdk11
  • Visual Studio Code version: 1.43.2
  • Java extension version: 0.59.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:27 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
snjezacommented, May 26, 2020

@a-st @jsaulou You can try to add the following code:

eclipse {
    project { 
        resourceFilter {
        matcher {
            id = 'org.eclipse.core.resources.regexFilterMatcher'
            arguments = "node_modules|.git"
        }
    }
  }
}

to your build.gradle file.

buildship doesn’t support Eclipse resource filters. See https://github.com/eclipse/buildship/issues/271 You can add them to your .project file using the following command:

./gradlew eclipse
2reactions
andywarren86commented, Jun 4, 2020

I also recently noticed a large increase in the time required to synchronise the project. I too have a project with a nested node_modules folder. While ignoring node_modules as per above comments helped, it was still taking a while. I reverted the plugin back to v61 and sync speed dropped back to only a few seconds.

Has anything changed in v62 that could have caused this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve the Performance of Gradle Builds
Build performance is critical to productivity. The longer builds take to complete, the more likely they'll disrupt your development flow. Builds run many...
Read more >
Building and running app via Gradle and Android Studio is ...
The next step is to enable the Gradle daemon and parallel build for your project. Parallel builds will cause your projects with multiple...
Read more >
Optimize your build speed | Android Developers
Learn about techniques to help you improve your Android project build speed. ... Gather the output when we are in single mode and...
Read more >
10 Gradle best practices to supercharge your project
That could be a lot of unnecessary file reads. Save yourself from future pain and always include a settings.gradle file! 4. Move tasks...
Read more >
How to increase your Gradle Build Speed? - DigitalOcean
The gradle speed for even the simplest project is pretty slow. ... save those extra seconds per build and that makes a big...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found