[rules-users] 答复: MVEL performance penalty
Zhuo Li
milanello1998 at gmail.com
Thu Jan 5 08:53:59 EST 2012
Hi, Laun,
I might be dull but what does this indicate? Drools did OPTIMIZE MVEL
dialect? But call it twice means optimization?
Best
Abe
发件人: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] 代表 Wolfgang Laun
发送时间: 2012年1月5日 16:53
收件人: Rules Users List
主题: [rules-users] MVEL performance penalty
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/12954b3d/attachment.html
More information about the rules-users
mailing list