I was careful to start a new thread with an appropriate subject that (I think) indicates that MVEL causes trouble. The boldface sentence says that dialect MVEL executes two calls where dialect Java succeeds with a single call.<br>
<br>(I don't think that the original poster really saw an "optimization".)<br><br>-W<br><br><br><div class="gmail_quote">2012/1/5 Zhuo Li <span dir="ltr"><<a href="mailto:milanello1998@gmail.com">milanello1998@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204,204,204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div link="blue" vlink="purple" lang="ZH-CN">
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">Hi, Laun,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">I might be dull but what does this indicate? Drools did OPTIMIZE
MVEL dialect? But call it twice means optimization?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">Best<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US">Abe<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Calibri","sans-serif";color:rgb(31,73,125)" lang="EN-US"><u></u> <u></u></span></p>
<div style="border-style:solid none none;border-color:rgb(181,196,223) -moz-use-text-color -moz-use-text-color;border-width:1pt medium medium;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:SimSun">发件人<span lang="EN-US">:</span></span></b><span style="font-size:10pt;font-family:SimSun" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] </span><b><span style="font-size:10pt;font-family:SimSun">代表 </span></b><span style="font-size:10pt;font-family:SimSun" lang="EN-US">Wolfgang Laun<br>
</span><b><span style="font-size:10pt;font-family:SimSun">发送时间<span lang="EN-US">:</span></span></b><span style="font-size:10pt;font-family:SimSun" lang="EN-US"> 2012</span><span style="font-size:10pt;font-family:SimSun">年<span lang="EN-US">1</span>月<span lang="EN-US">5</span>日<span lang="EN-US">
16:53<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> Rules Users List<br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US">
[rules-users] MVEL performance penalty<u></u><u></u></span></span></p>
</div><div><div class="h5">
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12pt"><span lang="EN-US">Drools 5.3.0
FINAL.<br>
<br>
This experiment was inspired by code posted with the insinuation that MVEL
would "optimize" condition evaluation. - Consider this rule:<br>
<br>
rule "Term - java"<br>
dialect "java"<br>
when<br>
$ea : EasyApp( Test.valueInList( $ea.getProductCode(), "CAR"
)==true<br>
&& age
< 0 )<br>
then end<br>
<br>
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:<br>
<br>
rule "Term - mvel"<br>
dialect "mvel"<br>
when<br>
$ea : EasyApp( Test.valueInList( productCode, "CAR"
)==true<br>
&&
age < 0 )<br>
then end<br>
<br>
<b><i>Now Test.valueInList() is called twice for each inserted fact.</i></b><br>
<br>
Cheers<br>
Wolfgang<br>
<br>
<u></u><u></u></span></p>
</div></div></div>
</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>