You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Antoine DESSAIGNE (JIRA)" <ji...@apache.org> on 2013/05/07 14:33:15 UTC

[jira] [Created] (CAMEL-6340) Improve Groovy performance

Antoine DESSAIGNE created CAMEL-6340:
----------------------------------------

             Summary: Improve Groovy performance
                 Key: CAMEL-6340
                 URL: https://issues.apache.org/jira/browse/CAMEL-6340
             Project: Camel
          Issue Type: Improvement
          Components: camel-groovy
    Affects Versions: 2.10.3
            Reporter: Antoine DESSAIGNE


We noticed some performance issues with the execution of Groovy expression. In the {{GroovyExpression}} the script is parsed 2 times at each evaluation. You'll find attached a patch that caches the parsed-version of the scripts.

We did some performance tests with the following definition:
{noformat}
from("direct:start")
    .loop(10000)
    .setBody(new GroovyExpression("request.body + request.getHeader('CamelLoopIndex')"))
    .to("mock:ignore");
{noformat}
We took the average of 5 executions (without the first one):
|| use case || duration ||
| default, no cache | 52690ms |
| patched, with cache | 1017ms |
It's more than 50 times faster which is always nice to have

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira