Skip to content

Performance of Reconciling Spring Java #1068

Closed

Description

@fenjen

I have several projects in my Eclipse of which some are quite large. For one of the projects, Spring Boot will do "Reconciling Spring Java" for almost two minutes (1:52). This happens on each Eclipse startup, and when I change source code (like adding a comment to the end of a code line). Not only is it super slow, it also takes a lot of system resources.

  1. Spring Boot should ignore all non Spring Boot projects.
  2. Reconciling Spring Java should cache the results.

I haven't found any option to exclude my big project for Reconciling Spring Java - I tried adding the project name to Settings → Spring → Boot Dashboard → Exclude Projects (I don't think it's the correct place, but I haven't found anything else).

Activity

  1. BoykoAlex commented on Jul 5, 2023

    @BoykoAlex
    Contributor

    Is this large project a spring-boot project?

    You can also disbale spring-java reconciling but for all projects as a workaround...
    Screenshot 2023-07-05 at 10 57 41

  2. fenjen commented on Jul 5, 2023

    @fenjen
    Author

    No, it's not a Spring Boot project. I disabled spring-java reconciling globally, thanks!

  3. martinlippert commented on Jul 6, 2023

    @martinlippert
    Member

    Hey @fenjen, I would be interested in some additional details. Can you try something for me? I would like to see how much time and resources the symbol scanning consumes initially in your case if there are no symbols in the cache.

    Can you:

    • disable reconciling
    • enable the console logging for the Spring Boot language server (Preferences -> Language Servers -> Spring Language Server) - that way we can extract some information from the log output
    • shutdown the IDE
    • delete the symbol cache files (~/.sts4/.symbolCache)
    • restart the IDE
    • keep an eye on resource consumption

    In the language server log output, there should be messages showing up talking about scanning symbols for Java files and how much time it took. Would be interesting to see those lines (if possible).

    Since we don't have progress bar support for this symbol scanning in place, this stuff will not show up in the progress bar on the UI, but you will see the messages showing up in the log view and you should see some CPU and memory consumption on the system (from the language server process, not the IDE process). Would be interesting to hear your subjective impressions on this period, compared to the reconciling observations.

    Many many thanks upfront!!!

  4. fenjen commented on Jul 10, 2023

    @fenjen
    Author

    I disabled reconciling, enabled looging, ended Eclipse, removed all files in symbolCache and started Eclipse. But starting Eclipse always takes 100% of CPU and takes some time, so it's generally hard to tell how much slower it became with Spring Tools.

    The relevant part in Eclipse log:

    !ENTRY org.springframework.tooling.ls.eclipse.commons 1 0 2023-07-10 14:31:28.065
    !MESSAGE Command list starting LS: org.springframework.tooling.boot.ls
    
    [...]
    
    !ENTRY org.springframework.tooling.boot.ls 1 0 2023-07-10 14:32:04.131
    !MESSAGE Boot project ADDED: eu...
    
    !ENTRY org.springframework.tooling.boot.ls 1 0 2023-07-10 14:32:04.136
    !MESSAGE Starting Boot LS...
    
    !ENTRY org.springframework.tooling.boot.ls 1 0 2023-07-10 14:32:04.144
    !MESSAGE Started Boot LS process
    
    !ENTRY org.springframework.tooling.boot.ls 1 0 2023-07-10 14:32:04.149
    !MESSAGE Boot project ADDED: ...
    
    !ENTRY org.springframework.tooling.boot.ls 1 0 2023-07-10 14:32:04.153
    !MESSAGE Boot project ADDED: ...
    

    The symbolCache file of the big project is 680K. What I know is that reconciling made everything extremely slow.

  5. martinlippert commented on Jul 11, 2023

    @martinlippert
    Member

    @fenjen Thanks for giving this a try. I am looking at lines in the log that looks like this:

    08:33:29.358 [pool-4-thread-1] INFO  o.s.i.v.b.j.utils.SpringIndexerJava - scan java files for symbols for project: spring-petclinic took ms: 2044
    

    Would be interesting to see the numbers for your big project there (after deleting the files in symbols cache, of course)

  6. fenjen commented on Jul 11, 2023

    @fenjen
    Author

    Running find . -name '*log*' -exec zgrep SpringIndexerJava {} \; in my Eclipse workspace doesn't yield anything.

  7. 11 remaining items

  8. added 2 commits that reference this issue on Jul 20, 2023
  9. added this to the 4.20.0.RELEASE milestone on Jul 24, 2023
  10. added 6 commits that reference this issue on Jul 25, 2023
  11. martinlippert commented on Jul 31, 2023

    @martinlippert
    Member

    The majority of the work has been done in the https://github.com/spring-projects/sts4/commits/jdt-diagnostics-via-symbols branch and is scheduled to ship as part of the 4.20.0 release, scheduled for end of September 2023. Therefore closing this item here for now.

  12. martinlippert commented on Jul 31, 2023

    @martinlippert
    Member

    Early versions of this will be available once the 4.19.1 release is out and the work is being merged into main. Once that is done, this will be included in the CI builds for Eclipse and VSCode.

  13. iloveuaa commented on Aug 16, 2023

    @iloveuaa

    i want change to idea

  14. martinlippert commented on Aug 17, 2023

    @martinlippert
    Member

    i want change to idea

    If you mean IntelliJ IDEA, it provides awesome support for working with Spring (Boot) applications in the IntelliJ Ultimate Edition, so feel free to jump to that IDE to work on your Spring applications, if you would prefer that environment.

    If you are using the Spring Tools 4 for Eclipse or VSCode and you are observing issues, please provide more details what exactly the issues are, so that we can work on them and ship an improved version to you as soon as possible.

    In case you are observing issues, especially performance-related trouble while having the Java source reconciling activated, please de-activate this (as described above) for the moment. A vastly improved version of the source reconciling is in the works and will ship soon.

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: vscodetheme: spring index & symbolstheme: validationtype: bugtype: enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions