Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
ResolveVisitor will try to look up default imported classes from these packages "java.lang.", "java.util.", "java.io.", "java.net.", "groovy.lang.", "groovy.util.".
For example, when compiler finds Closure in the AST, it will try to look up "java.util.Closure", if failed, then "java.io.Clousre", ..., at last look up "groovy.lang.Closure".
As we can see, some of the above looking up is not necessary, we can avoid them by warming up org.codehaus.groovy.control.ResolveVisitor#DEFAULT_IMPORT_CLASS_AND_PACKAGES_CACHE
P.S. warming up the cache costs about 0.226s on my machine
Attachments
Issue Links
- is related to
-
GROOVY-9416 Avoid unnecessary looking up non default import classes when resolving types
- Closed
- links to