Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9236

Avoid unnecessary resolving

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0-rc-1
    • Component/s: None
    • Labels:
      None

      Description

      ResolveVisitor's resolveFromStaticInnerClasses, resolveFromDefaultImports and resolveNestedClass will try to guess class qualified name and load. In the process of resolving, lots of time wasted on finding non-existing classes. So we should try to resolve classes in a determined manner.

      For example,
      For java.util.stream.Collectors, ① resolveFromStaticInnerClasses will try to guess java.util.stream$Collectors, java.util$stream$Collectors, java$util$stream$Collectors.
      And ② resolveFromDefaultImports will guess java.lang.java$util$stream$Collectors, java.util.java$util$stream$Collectors, ..., groovy.lang.java$util$stream$Collectors.

      After the precedence of resolving adjusted, the above unnecessary resolving can be avoided.

      See the discussion in the dev mailing list: http://groovy.329449.n5.nabble.com/Performance-of-the-compiler-tt5750989.html
      and its attachment: http://groovy.329449.n5.nabble.com/attachment/5750989/0/CPU-hot-spots.txt

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                daniel_sun Daniel Sun
                Reporter:
                daniel_sun Daniel Sun
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4h 20m
                  4h 20m