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.

Whole project recompiles with each keystroke

See original GitHub issue

Sometime between version 0.64.1 and now, the build triggering behavior seems to have changed. Whereas changes within a file still produced a reasonably fast auto-complete, it seems like each keystroke now triggers a rebuild of the entire project including the edited file, other files in the project and all declared Java dependencies. This seems to generally make auto-complete unusable since one is likely typing around the time auto-complete is needed and if each keystroke triggers a 1 minute build, auto-complete is generally always loading.

Perhaps it’s possible to restrict the rebuilding to the edited file, or cache all the symbols from the previous build until the next build is ready?

Environment
  • Operating System: macOS 10.15
  • JDK version: 11.0.4
  • Visual Studio Code version: 1.52.1
  • Java extension version: 0.64.1
Additional Informations

When I start typing, it triggers the below in the Java Build Status pane. Each build takes a few minutes.

8394ded0 Building [Done]
ba7e2d19 Validate documents [Done]
00cd587d Publish Diagnostics [Done]
c9fb754c Building [Done]
467b8d20 Building [Done]
a25e99a1 Validate documents [Done]
411b4544 Publish Diagnostics [Done]
c1bd89da Building [Done]
240f6be2 Building [Done]
a3536bca Building [Done]
6cea6ad2 Building [Done]

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
dbarvitskycommented, Aug 11, 2022

The “Publish Diagnostics” takes the longest for me. I frequently see java processes (2 of them because of the hybrid mode) in the background hugging the CPU (200-300% spikes), notably after the change to a Java file is made. It slows down the intellisence, and one has to wait for good 10-30 seconds for the auto-completion hints to appear. I attempted the following:

  • setting user-level "telemetry.telemetryLevel": "crash" - didn’t have any effect (would be nice if Java respected that, actually).
  • setting workspace-level "redhat.telemetry.enabled": null or false - seems like does not have any effect and only applies to the Kubernetes plugin.
  • reloading the vscode, clearing the Java workspace cache, etc - nothing worked.

If I can make a suggestion:

  • it would be nice if background compilation could be debounced somehow (i.e. start background build after a few seconds of accumulating changes and after there has been no changes for couple more seconds). This way we would not have “wasted” compilation cycles as user types.
  • do not block intellisense and auto-completion on background tasks. I’d rather have it slightly out of date but immediately available rather than waiting half of minute for it to come back with a better result. For things like refactoring I don’t mind waiting though.
2reactions
xstercommented, Jan 15, 2021

Thanks.

File auto save is off. I’m trying now on 0.73.0 with Java 11. Same symptom. I think the “building” messages are actually doing something, since each of them breaks down (while running) into a building 123/1000 files message.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compile files without build | CLion Documentation - JetBrains
For a file in the project tree, use the Recompile option from the right-click menu (or use the same Ctrl+Shift+F9 shortcut):.
Read more >
How do I stop Visual Studio from building dependencies that ...
Alt + B, U will build just your current project. Good shortcut if you don't want build all ...
Read more >
Force Recompile option in Mass Compile - NI Community
Sometimes I genuinely want a full recompilation of literally everything in my Project. The existing method (CTRL+Shift Run Arrow) isn't ...
Read more >
Build plugin prevent to use incremental compilation when ...
I think that incremental compilation can help a lot with our big projects, ... Changing constants usually causes Gradle to perform a full...
Read more >
CS107 Compiling Programs with Make
Make is a program that dates back to 1976, and it is used to build projects with dependencies such that it only recompiles...
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