[rules-users] MVEL performance penalty

Wolfgang Laun wolfgang.laun at gmail.com
Thu Jan 5 03:52:51 EST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120105/38bafe1c/attachment.html 


More information about the rules-users mailing list