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/02/07 14:13:00 UTC

[jira] [Updated] (GROOVY-8977) Collect default imported class info for better resolving performance

     [ https://issues.apache.org/jira/browse/GROOVY-8977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sun updated GROOVY-8977:
-------------------------------
    Description: 
Collect default imported class info to improve the hit ratio of cache with classgraph, which will not be included in the groovy distributions. 

The collected default imported class info will be saved in directory {{.groovy}} under user home, the cache file name is {{default_imported_classes}}. The cache file contains  groovy version, java version and default imported class info. When the groovy version or java version changes, the cache file will be updated.

Option {{collectDefaultImports}} for compiler configuration and {{groovy.collect.default.imports}} for JVM is disabled by default because the 3rd-party lib classgraph is not included in groovy core. So we have to place classgraph lib in the classpath and switch on either of the options to enable the optimization feature.

On my local machine, the performance of resolving default imported class is improved:
||#||default||collectDefaultImports||percentage of time saved||
|1|2895|1629|43.73056994818653%|
|2|2702|1777|34.233900814211694%|
|3|2719|1931|28.981243104082385%|
|4|2621|1560|40.48073254483022%|

> Collect default imported class info for better resolving performance
> --------------------------------------------------------------------
>
>                 Key: GROOVY-8977
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8977
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 3.0.0-alpha-5
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Collect default imported class info to improve the hit ratio of cache with classgraph, which will not be included in the groovy distributions. 
> The collected default imported class info will be saved in directory {{.groovy}} under user home, the cache file name is {{default_imported_classes}}. The cache file contains  groovy version, java version and default imported class info. When the groovy version or java version changes, the cache file will be updated.
> Option {{collectDefaultImports}} for compiler configuration and {{groovy.collect.default.imports}} for JVM is disabled by default because the 3rd-party lib classgraph is not included in groovy core. So we have to place classgraph lib in the classpath and switch on either of the options to enable the optimization feature.
> On my local machine, the performance of resolving default imported class is improved:
> ||#||default||collectDefaultImports||percentage of time saved||
> |1|2895|1629|43.73056994818653%|
> |2|2702|1777|34.233900814211694%|
> |3|2719|1931|28.981243104082385%|
> |4|2621|1560|40.48073254483022%|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)