You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Oleg (Jira)" <ji...@apache.org> on 2021/07/09 10:52:00 UTC

[jira] [Updated] (GROOVY-10163) GroovyShell parse method performance issue

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

Oleg updated GROOVY-10163:
--------------------------
    Description: 
GroovyShell() method *parse​(URI uri)* works a lot slower than *parse​(String scriptText)*

 

I have a script located in a remote server, it has around 400 lines of code. And it takes *8 seconds* to download and parse this code with *parse​(URI uri):*

 
{code:java}
Date start = new Date()

def url = new URI("https://someurl")
def script = new GroovyShell(binding).parse(url)

return TimeCategory.minus(new Date(), start).toString(){code}
 

 

However, if I download first, and than parse text, it is much faster. To download and parse the same script using *parse​(String scriptText), ** it takes only *1.5 seconds*:

 
{code:java}
Date start = new Date()

def url = "https://someurl".toURL()
def script = new GroovyShell(binding).parse(url.text)

return TimeCategory.minus(new Date(), start).toString(){code}
 

  was:
GroovyShell() method *parse​(URI uri)* works a lot slower than *parse​(String scriptText)*

 

I have a script located in a remote server, it has around 400 lines of code. And it takes *8 seconds* to download and parse this code with *parse​(URI uri):*

 
{code:java}
Date start = new Date()

def url = new URI("https://someurl")
def script = new GroovyShell(binding).parse(url)

return TimeCategory.minus(new Date(), start).toString(){code}
 

 

However, if I download first, and than parse text, it is much faster. To download and parse the same script using *parse​(String scriptText),* it takes only *1.5 seconds*:

 
{code:java}
Date start = new Date()

def url = "https://someurl".toURL()
def script = new GroovyShell(binding).parse(url.text)

return TimeCategory.minus(new Date(), start).toString(){code}
 


> GroovyShell parse method performance issue
> ------------------------------------------
>
>                 Key: GROOVY-10163
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10163
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Oleg
>            Priority: Minor
>
> GroovyShell() method *parse​(URI uri)* works a lot slower than *parse​(String scriptText)*
>  
> I have a script located in a remote server, it has around 400 lines of code. And it takes *8 seconds* to download and parse this code with *parse​(URI uri):*
>  
> {code:java}
> Date start = new Date()
> def url = new URI("https://someurl")
> def script = new GroovyShell(binding).parse(url)
> return TimeCategory.minus(new Date(), start).toString(){code}
>  
>  
> However, if I download first, and than parse text, it is much faster. To download and parse the same script using *parse​(String scriptText), ** it takes only *1.5 seconds*:
>  
> {code:java}
> Date start = new Date()
> def url = "https://someurl".toURL()
> def script = new GroovyShell(binding).parse(url.text)
> return TimeCategory.minus(new Date(), start).toString(){code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)