Oleg created GROOVY-10163:
-----------------------------
Summary: GroovyShell parse method performance issue
Key: GROOVY-10163
URL: https://issues.apache.org/jira/browse/GROOVY-10163
Project: Groovy
Issue Type: Bug
Reporter: Oleg
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)