Spring IDE
  1. Spring IDE
  2. IDE-1064

Improve performance of classpath scanning during workspace build

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: None
    • Labels:
      None

      Description

      After initial discussion in the forum (see attached forum reference), I used VisualVM to grab a handful of stack dumps of STS 2.3 when it gets stuck in the "loading ..." stage of a workspace build. See attached stack dumps.

      In each case, the culprit is clear; it's the thread which is performing some heavy classpath scanning, seemingly chunking through every JAR file in the workspace classpath. It seems to be rescanning this classpath every time Eclipse's builder kicks off (e.g. changing a class's method signature, any change to a spring beans file), and for large workspaces within a couple of dozen projects and several dozen JAR dependencies, this is cripplingly slow.

      I could post some beans files also, but there are many, many of them, and finding the wood for the trees might be hard.

      1. stack1.txt
        22 kB
        Kenny MacLeod
      2. stack2.txt
        26 kB
        Kenny MacLeod
      3. stack3.txt
        24 kB
        Kenny MacLeod
      4. stack4.txt
        23 kB
        Kenny MacLeod

        Activity

        Hide
        Christian Dupuis added a comment -

        Kenny, thanks for raising this.

        Are you using imports in your config files or component-scanning? From the stacktrace I would assume that you have import processing enabled in the settings (Spring -> Beans Support -> Enable support imports). Is that true?

        Just for testing purposes can you disable this and retry? Until I fix this issue could you configure Spring IDE/STS to use Config Sets instead of processing the imports? This should give you the same level of support with much better performance.

        Christian

        Show
        Christian Dupuis added a comment - Kenny, thanks for raising this. Are you using imports in your config files or component-scanning? From the stacktrace I would assume that you have import processing enabled in the settings (Spring -> Beans Support -> Enable support imports). Is that true? Just for testing purposes can you disable this and retry? Until I fix this issue could you configure Spring IDE/STS to use Config Sets instead of processing the imports? This should give you the same level of support with much better performance. Christian
        Hide
        Kenny MacLeod added a comment -

        Ah, that's made a huge difference, thank you

        We don't actually make much use of <import>, but most of the projects were configured to support it, and all it takes is for a couple of the common project dependencies to use it, and the performance tanks.

        Is this the sort of thing that can be fixed, or will <import> support always be slow?

        Show
        Kenny MacLeod added a comment - Ah, that's made a huge difference, thank you We don't actually make much use of <import>, but most of the projects were configured to support it, and all it takes is for a couple of the common project dependencies to use it, and the performance tanks. Is this the sort of thing that can be fixed, or will <import> support always be slow?
        Hide
        Christian Dupuis added a comment -

        No, I consider this a bug as the algorithm for resolving imports is not clever at all.

        I'll work on this and let you know. It would be good to get some feedback once I have a fix for this.

        Christian

        Show
        Christian Dupuis added a comment - No, I consider this a bug as the algorithm for resolving imports is not clever at all. I'll work on this and let you know. It would be good to get some feedback once I have a fix for this. Christian
        Hide
        Christian Dupuis added a comment -

        Kenny,

        can you test the latest nightly snapshot. I've changed the implementation and in my tests the performance is significantely better now.

        Let me know how it behaves for you.

        Christian

        Show
        Christian Dupuis added a comment - Kenny, can you test the latest nightly snapshot. I've changed the implementation and in my tests the performance is significantely better now. Let me know how it behaves for you. Christian

          People

          • Assignee:
            Christian Dupuis
            Reporter:
            Kenny MacLeod
          • Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: