Skip to content

[vscode] Spring Boot Tools slow down code complete #808

Closed

Description

@degbug

Describe the bug
when I install Spring Boot Tools in vscode, it slow down the speed of code completions.

Kapture 2022-08-05 at 11 47 36

I seen the plugin log show :

11:47:32.155 [pool-8-thread-1] INFO  o.s.i.v.c.l.u.SimpleTextDocumentService - change message work done in 1723ms

To Reproduce

Sample

https://github.com/degbug/demo

this is the log file:
boot.log.txt

Activity

  1. martinlippert commented on Aug 5, 2022

    @martinlippert
    Member

    Thanks for reporting this @degbug. Slowing down typing speed or completion performance is an absolute no-go here. We need to investigate. Thanks for attaching the log output, that is a great starting point.

    From what I can see, it looks like the slowdown happens sometimes, and sometimes it doesn't. Did you observe any special action or sequence of activities that triggers the slowdown?

  2. added this to the 4.16.0.RELEASE milestone on Aug 5, 2022
  3. degbug commented on Aug 5, 2022

    @degbug
    Author

    Thanks for reporting this @degbug. Slowing down typing speed or completion performance is an absolute no-go here. We need to investigate. Thanks for attaching the log output, that is a great starting point.

    From what I can see, it looks like the slowdown happens sometimes, and sometimes it doesn't. Did you observe any special action or sequence of activities that triggers the slowdown?

    @martinlippert No, I didn't observed. When I first open the project and first typing is quickly, but then it become very easy to triggers the slowdown. But I don't know what cause this.
    The log file contains many error log, this may affect this?

  4. reopened this on Aug 5, 2022
  5. youngm commented on Aug 5, 2022

    @youngm

    I'm having a similar issue with 4.15.2 on eclipse. I didn't have time to dig into it and create an issue/reproduction. I had to revert to 4.15.1 to get my work done.

  6. BoykoAlex commented on Aug 6, 2022

    @BoykoAlex
    Contributor
  7. degbug commented on Aug 6, 2022

    @degbug
    Author

    @degbug please try this vsix and let us know if this works better for you: https://s3.us-west-1.amazonaws.com/s3-test.spring.io/sts4/vscode-extensions/snapshots/vscode-spring-boot-1.38.0-202208052243.vsix @youngm please try upgrading STS eclipse from the snapshot update site. Should be good to update on Monday. Curious if it works any better: https://dist.springsource.com/snapshot/TOOLS/sts4/nightly/e4.24

    @BoykoAlex I have try vscode-spring-boot-1.38.0-202208052243.vsix, It works better than before. but still work slow than disable the vscode-spring-boot extensions.

    this is the log file:
    boot.log6.txt

    And I saw error in log:

    11:19:21.762 [pool-3-thread-1] ERROR o.s.i.v.b.j.utils.SymbolCacheOnDisc - cannot write symbol cache
    java.io.FileNotFoundException: /Users/degbug/.sts4/.symbolCache/degbug-auto-task-java--A71297B3246476FA87DEC5893F93A8BB.json (Too many open files)
    	at java.base/java.io.FileOutputStream.open0(Native Method)
    	at java.base/java.io.FileOutputStream.open(Unknown Source)
    	at java.base/java.io.FileOutputStream.<init>(Unknown Source)
    	at java.base/java.io.FileOutputStream.<init>(Unknown Source)
    	at java.base/java.io.FileWriter.<init>(Unknown Source)
    	at org.springframework.ide.vscode.boot.java.utils.SymbolCacheOnDisc.save(SymbolCacheOnDisc.java:259)
    	at org.springframework.ide.vscode.boot.java.utils.SymbolCacheOnDisc.update(SymbolCacheOnDisc.java:236)
    	at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFilesInternally(SpringIndexerJava.java:316)
    	at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanAffectedFiles(SpringIndexerJava.java:347)
    	at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.scanFiles(SpringIndexerJava.java:191)
    	at org.springframework.ide.vscode.boot.java.utils.SpringIndexerJava.updateFiles(SpringIndexerJava.java:145)
    	at org.springframework.ide.vscode.boot.app.SpringSymbolIndex.lambda$updateItems$28(SpringSymbolIndex.java:727)
    	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.base/java.lang.Thread.run(Unknown Source)
    
  8. 4 remaining items

  9. martinlippert commented on Aug 8, 2022

    @martinlippert
    Member

    Quick update:

    I tried this with the various versions. I can clearly reproduce the slowdown when using the latest release version 1.37.0, I can clearly see it running A LOT faster and more fluent with 1.36.0. The snapshot version 1.38.0-202208052243 seems to be a lot faster than 1.37.0 faster than your recording from above, but not quite at the 1.36.0 level.

    The question is, why. The log indicate that the overall content-assist performance from the Spring Boot language server seems to be okay-ish and fast, so it doesn't look like the editor waits for the language server to return content-assist information.

    Looks like some additional investigations are necessary here... We will continue with that...

  10. martinlippert commented on Aug 8, 2022

    @martinlippert
    Member

    When looking at what exactly the language server is doing, it looks to me like nothing is really blocking the code completion anymore, but too much other stuff is going on:

    thread-dump-while-busy.txt

  11. BoykoAlex commented on Aug 8, 2022

    @BoykoAlex
    Contributor

    I've pushed d557c0d to turn off the Rewrite reconcile bits by default. Will wait for the build to go through, smoke test it and then provide a link to the build here

  12. BoykoAlex commented on Aug 9, 2022

    @BoykoAlex
    Contributor

    @degbug Here is the new build to try: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html At the bottom of the page please download vscode-spring-boot vsix file. I hope typing will become the same as before. If this is the case wonder if you could find in Preferences -> Settings then under Extensions -> Boot-Java Config find the setting Boot-java › Rewrite: Reconcile (should be unchecked by default) check mark and try typing again just like before. Do you see much difference?

  13. degbug commented on Aug 10, 2022

    @degbug
    Author

    @degbug Here is the new build to try: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html At the bottom of the page please download vscode-spring-boot vsix file. I hope typing will become the same as before. If this is the case wonder if you could find in Preferences -> Settings then under Extensions -> Boot-Java Config find the setting Boot-java › Rewrite: Reconcile (should be unchecked by default) check mark and try typing again just like before. Do you see much difference?

    @BoykoAlex
    I tried vscode-spring-boot-1.38.0-202208091607.vsix and feel it faster than vscode-spring-boot-1.38.0-202208052243.vsix。 And feel like 1.36.

    But no matter I enable or disable the Rewrite: Reconcile option. I feel it behavior is same.

    This is the log first install the vscode-spring-boot-1.38.0-202208091607.vsix
    boot.log1.38.nightly_open_and_close.txt

    And I notice that when I enable the Rewrite: Reconcile option, the log can not output.

    When I reopen the project it appear.
    this is the log after I reopen project:
    boot.log1.38.nightly_close.txt

    And this is the log of vscode-spring-boot-1.38.0-202208052243.vsix.
    When I rollback to vscode-spring-boot-1.38.0-202208052243.vsix it become slowly.
    boot.log1.38_0805.txt

  14. BoykoAlex commented on Aug 10, 2022

    @BoykoAlex
    Contributor

    Thanks very much for trying the build out :-) Sounded like https://s3-us-west-1.amazonaws.com/s3-test.spring.io/sts4/vscode-extensions/snapshots/vscode-spring-boot-1.38.0-202208091607.vsix worked just like 1.36 and in both cases: rewrite reconcile off and on. If this is correct I suppose we should get to start releasing STS4 with the fix we've put in.

  15. youngm commented on Aug 10, 2022

    @youngm

    FWIW, I tried out the latest nightly in eclipse and the slowness I was experiencing appears to be fixed as well.

  16. martinlippert commented on Aug 10, 2022

    @martinlippert
    Member

    @youngm Thanks for trying this and letting us know, very very much appreciated. The maintenance release 4.15.3 should go live tomorrow (most likely).

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

    for: eclipsefor: vscodestatus: in-progresstheme: performancetype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions