[rules-users] MVEL performance penalty

Mark Proctor mproctor at codehaus.org
Thu Jan 5 09:38:05 EST 2012


Wolfgang,

Sound like a bug. If you insert a single object, the method should be 
called just once.

Mark
On 05/01/2012 08:52, Wolfgang Laun wrote:
> Drools 5.3.0 FINAL.
>
> This experiment was inspired by code posted with the insinuation that 
> MVEL would "optimize" condition evaluation. - Consider this rule:
>
> rule "Term - java"
> dialect "java"
> when
>    $ea : EasyApp( Test.valueInList( $ea.getProductCode(), "CAR" )==true
> && age < 0 )
> then end
>
> You'd expect that Test.valueInList() is called once per inserted 
> EasyApp fact, and this can be verified easily. - Now the same rule, 
> with MVEL's syntactic sugar:
>
> rule "Term  - mvel"
> dialect "mvel"
> when
>     $ea : EasyApp( Test.valueInList( productCode, "CAR" )==true
> && age < 0 )
> then end
>
> /*Now Test.valueInList() is called twice for each inserted fact.*/
>
> Cheers
> Wolfgang
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120105/255f0f5a/attachment.html 


More information about the rules-users mailing list