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 2020/10/20 10:49:00 UTC

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

Stephen Mallette created GROOVY-9785:
----------------------------------------

             Summary: 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


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.3.4#803005)