groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8977) Collect default imported class info for better resolving performance
Date Thu, 07 Feb 2019 16:59:00 GMT

     [ 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 complete the following step2:
 # place classgraph lib in the classpath(e.g. in gradle projects,
{code:java}
runtime 'io.github.classgraph:classgraph:4.6.32'{code}
and in common cases, put {{classgraph-4.6.32.jar}} into directory {{lib}} under groovy home);

 # switch on either of the above options to enable the optimization feature.

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

  was:
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 complete the following step2:
 # place classgraph lib in the classpath(e.g. in gradle projects, {code:java}runtime 'io.github.classgraph:classgraph:4.6.32'{code}
and in common cases, put {{classgraph-4.6.32.jar}} into directory {{lib}} under groovy home);

 # switch on either of the above options to enable the optimization feature.

On my local machine, the performance of resolving default imported class is improved {{36.93883149%}} by
average:
||#||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 complete the following step2:
>  # place classgraph lib in the classpath(e.g. in gradle projects,
> {code:java}
> runtime 'io.github.classgraph:classgraph:4.6.32'{code}
> and in common cases, put {{classgraph-4.6.32.jar}} into directory {{lib}} under groovy
home);
>  # switch on either of the above options to enable the optimization feature.
> On my local machine, the performance of resolving default imported class is improved
{{36.93883149%}} by average:
> ||#||default(ms)||collectDefaultImports(ms)||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)

Mime
View raw message