You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2019/09/02 16:39:00 UTC

[jira] [Comment Edited] (GROOVY-9236) Avoid unnecessary resolving

    [ https://issues.apache.org/jira/browse/GROOVY-9236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16920961#comment-16920961 ] 

Daniel Sun edited comment on GROOVY-9236 at 9/2/19 4:38 PM:
------------------------------------------------------------

[~emilles] I just remember the cost of resolving has been discussed in the dev mailing, but it's quite hard for me to find the thread as it is very very old...

BTW, I'm trying to ask [~melix] for help to review the PR too ;-)



was (Author: daniel_sun):
[~emilles] I'm trying to ask [~melix] for help to review the PR too ;-)

> Avoid unnecessary resolving
> ---------------------------
>
>                 Key: GROOVY-9236
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9236
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 3.0.0-beta-4
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> {{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



--
This message was sent by Atlassian Jira
(v8.3.2#803003)