Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.10.3
-
Unknown
Description
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:
from("direct:start") .loop(10000) .setBody(new GroovyExpression("request.body + request.getHeader('CamelLoopIndex')")) .to("mock:ignore");
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
Attachments
Attachments
Issue Links
- is related to
-
CAMEL-6988 2.12.1 caches groovy call - resulting with previous caller state
- Resolved