You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Stephen Mallette (Jira)" <ji...@apache.org> on 2023/01/11 19:39:00 UTC

[jira] [Commented] (GROOVY-9785) Performance degradation of groovysh for long scripts

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

Stephen Mallette commented on GROOVY-9785:
------------------------------------------

Versions of groovy after 2.5.15 seem to show the same performance issues noted here for 3.x and 4.x. A recent attempt to use 3.0.14 demonstrated that this performance issue persists. 

Can anyone say what changed after 2.5.15 (i.e. 2.5.16+) to bring about this performance problem? Does it help shed any light on why we see the performance issues we do in 3.x and 4.x?

> Performance degradation of groovysh for long scripts
> ----------------------------------------------------
>
>                 Key: GROOVY-9785
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9785
>             Project: Groovy
>          Issue Type: Bug
>          Components: Groovysh
>    Affects Versions: 3.0.6
>            Reporter: Stephen Mallette
>            Priority: Major
>         Attachments: groovy-2.5.13.jfr, groovy-3.0.6.jfr, test-groovysh-incomplete-multiline.groovy
>
>
> This issue was initially raised on the groovy-users mailing list ([here|https://lists.apache.org/thread.html/rb3ccd13570642038e822bd3e430999e0f5f430543edfdae92e895c0f%40%3Cusers.groovy.apache.org%3E]). The general issue is that long scripts pasted to groovysh in 3.x are parsed/read much more slowly than prior 2.x versions. From the mailing list:
> {code}
> groovy:000> start = System.currentTimeMillis()
> ===> 1603105239050
> groovy:000> 1 + 10 +
> groovy:001> 1 + 10 +
> groovy:002> 1 + 10 +
> groovy:003> 1 + 10 +
> groovy:004> 1 + 10 +
> groovy:005> 1 + 10 +
> groovy:006> 1 + 10 +
> ...
> groovy:495> 1 + 10 +
> groovy:496> 1 + 10 +
> groovy:497> 1 + 10
> ===> 5478
> groovy:000> System.currentTimeMillis() - start
> ===> 1193
> and on 3.0.6 I got:
> groovy:000> start = System.currentTimeMillis()
> ===> 1603105244825
> groovy:000> 1 + 10 +
> groovy:001> 1 + 10 +
> groovy:002> 1 + 10 +
> groovy:003> 1 + 10 +
> groovy:004> 1 + 10 +
> groovy:005> 1 + 10 +
> groovy:006> 1 + 10 +
> ...
> groovy:495> 1 + 10 +
> groovy:496> 1 + 10 +
> groovy:497> 1 + 10
> ===> 5478
> groovy:000> System.currentTimeMillis() - start
> ===> 31876
> {code}
> Note that JFRs are attached - perhaps they will shed some light on what is happening to someone familiar with the code.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)