[ 
https://issues.apache.org/jira/browse/CAMEL-11484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068937#comment-16068937
 ] 

Claus Ibsen edited comment on CAMEL-11484 at 6/29/17 8:34 PM:
--------------------------------------------------------------

This only applies to more complex simple languages with nested functions, which 
would cause being evaluated per exchange, which then would create a new simple 
expression, that was not cached/reused. For example to call a random function 
where the max value is a nested simple expression
{code}
${random(1,${header.max})}
{code}

Then at runtime, header.max is created as a new simple expression each time. By 
using the cache we can avoid this overhead. 

For non nested simple expressions then they are fast today, eg
{code}
${body}
{code}
Or 
{code}
Hello ${body} how are ${headers.foo} today
{code}


was (Author: davsclaus):
This only applies to more complex simple languages with nested functions, which 
would cause being evaluated per exchange, which then would create a new simple 
expression, that was not cached/reused. For example to call a random function 
where the max value is a nested simple expression
{code}
${random(1,${header.max})}
{code}

Then at runtime, header.max is created as a new simple expression each time. By 
using the cache we can avoid this overhead. 

> Optimise - Simple Language / ExpressionBuilder can use cache of frequent used 
> expressions
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-11484
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11484
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.20.0
>
>
> If you use a simple expression in a Camel route that has a simple token, then 
> it's re-created per exchange during routing. The expression by itself can be 
> cached and reused, which avoids using the simple parser over and over again.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to