<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hehl, Thomas wrote:
<blockquote
 cite="mid:6D5A17BA296710439495D536303041301AFFBE@lexexcu00.gs.acs-inc.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
  <o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City"><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
  <style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h1
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:16.0pt;
        font-family:Arial;}
h2
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:Arial;
        font-style:italic;}
h3
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:Arial;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        text-align:center;
        font-size:16.0pt;
        font-family:Arial;
        font-weight:bold;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        text-indent:.5in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        text-align:center;
        font-size:12.0pt;
        font-family:Arial;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p.Code, li.Code, div.Code
        {margin:0in;
        margin-bottom:.0001pt;
        background:#F3F3F3;
        border:none;
        padding:0in;
        font-size:9.0pt;
        font-family:"Courier New";}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
  </o:SmartTagType></o:SmartTagType>
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I did some
reading about shadow facts and
I was thinking about turning them off, but it seems to be that if I use
stateless sessions (session.execute()) that shadow facts are
irrelevant. Is
this true?</span></font></p>
  </div>
</blockquote>
No, only if you turn on sequential mode.<br>
<br>
Mark<br>
<blockquote
 cite="mid:6D5A17BA296710439495D536303041301AFFBE@lexexcu00.gs.acs-inc.com"
 type="cite">
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p></o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;"><o:p>&nbsp;</o:p></span></font></p>
  <div>
  <div class="MsoNormal" style="text-align: center;" align="center"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;">
  <hr tabindex="-1" align="center" size="2" width="100%"></span></font></div>
  <p class="MsoNormal"><b><font face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font
 face="Tahoma" size="2"><span
 style="font-size: 10pt; font-family: Tahoma;">
<a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] <b><span
 style="font-weight: bold;">On
Behalf Of </span></b>Edson Tirelli<br>
  <b><span style="font-weight: bold;">Sent:</span></b> Thursday, May
15, 2008 10:00
AM<br>
  <b><span style="font-weight: bold;">To:</span></b> Rules Users List<br>
  <b><span style="font-weight: bold;">Subject:</span></b> Re:
[rules-users]
JRules\Drools benchmarking...</span></font><o:p></o:p></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><o:p>&nbsp;</o:p></span></font></p>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
&nbsp;&nbsp; It seems you are using a good strategy to do your tests. But
still, it is difficult to explain why one is slower than the other
without
seeing the actual test code. This is because all the engines have
stronger and
weaker spots. Just to mention one example, some engines (not talking
specifically about drools and jrules, but about all engines) implement
faster
alpha evaluation, others implement faster beta (join) evaluation,
others
implement good optimizations for not() while others may focus on
eval(), etc.
It is up to the point that when comparing 2 engines, one performs
better in
hardware with a bigger L2 cache while the other performs better in
hardware
with a smaller L2 cache.<br>
  <br>
&nbsp;&nbsp; So, best I can do without looking at the actual tests is provide
you some tips:<br>
  <br>
1. First of all, are you using Drools 4.0.7? It is very important that
you use
this version over the previous ones.<br>
  <br>
2. Are you using stateful or stateless sessions? If you are using
stateful
sessions are you calling dispose() after using the session? If not, you
are
inflating your memory and certainly causing the engine to run slower
over time.<br>
  <br>
3. Are you sharing the rulebase among multiple requests? The drools
rulebase is
designed to be shared and the compilation process is eager and pretty
heavy compared
to session creation. So, it pays off to create the rulebase once and
share
among requests.<br>
  <br>
4. Did you disabled shadow facts? Test cases usually use a really small
fact
base, so would not be much affected by shadow facts, but still,
disabling them
improves performance, but require some best practices to be followed.<br>
  <br>
5. Do your rules follow best practices (similar to SQL writing best
practices),
i.e., write the most constraining patterns first, write the most
constraining
restrictions first, etc? Do you write patterns in the same order among
rules to
maximize node sharing? I guess you do, but worth mentioning anyway.<br>
  <br>
&nbsp;&nbsp; Anyway, just some tips.<br>
  <br>
&nbsp;&nbsp; Regarding the jrules blog, I know it, but I make a bet with you.
Download the manners benchmark to your machine, make sure the rules are
the
correct ones (not cheated ones), run the test on both engines and share
the
results. I pay you a beer if you get results similar to those published
in the
blog. :) <br>
&nbsp;&nbsp; My point is not that we are faster (what I know we are) or them
are faster. My point is that perf benchmarks for rules engines are a
really
tricky matter, with lots of variables involved, that make every test
case
configuration unique. Try to reproduce in a different environment and
you will
get different performance rates between the engines.<br>
  <br>
&nbsp;&nbsp; That is why, our recommendation is to always do what you are
doing: try your own use case. Now, whatever you are trying, I'm sure it
is
possible to optimize if we see the test case, but is it worth it? Or
the perf
as it is already meets your requirements?<br>
  <br>
&nbsp;&nbsp; Cheers,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br>
  <br>
PS: I'm serious about the beer... ;) run and share the results with
us... <br>
  <br>
  <o:p></o:p></span></font></p>
  <div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">2008/5/15 mmquelo massi &lt;<a
 moz-do-not-send="true" href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</a>&gt;:<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">You r right...<br>
  <br>
I have to tell you what I have done...<br>
  <br>
I did not define a "stand-alone" benchmark like the
"Manners" one.<br>
  <br>
I benchmarked a real j2ee application.<br>
  <br>
I have got jrules deployed with a resource adapter and drools deployed<br>
with simple jars libraries plus jbrms.<br>
  <br>
Jrules uses a "bres" module which does the same trick jbrms does.<br>
  <br>
Both of them are deployed on the same AS, in the same time, same<br>
machine (my laptop: dual core 2 duo 1.66, 2GB).<br>
  <br>
Using the inversion of control pattern I found out how to "switch the<br>
rule engine" at run-time. So I can easily choose then rule engine to<br>
use between drools and jrules.<br>
  <br>
Ofcourse thay have got two separate rule repositories but both of them<br>
persist the rules on the same DB which is <st1:City w:st="on"><st1:place
 w:st="on">Derby</st1:place></st1:City>.<br>
  <br>
The j2ee application I benchmarked sends a request object to the<br>
current rule engine and get back a reply from it. I just measured the<br>
elapsed time between the request and reply generation using drools<br>
first and the jrules.<br>
  <br>
I did the measurements tens of times.<br>
  <br>
Both rule engines implement the same rules and the Drools rules (which<br>
I personally implemented) are at least as optimized as the jrules<br>
ones. In the Jrules version of the rules there are a lot of<br>
"Eval(...)" blocks in the Drools version I did not use the
"Eval()" at<br>
all ....but I just did pattern matching.<br>
  <br>
If you want i can send you a more specific documentation but I hope<br>
this explanation will be enough to show you that the measurements I<br>
have done are not that bad.<br>
  <br>
In any case I noticed that after a warming-up phase, the drools engine<br>
gives a reply back 3 times slower than the jrules engine.<br>
  <br>
The link I have sent show you something related to it, It reports the<br>
manners execution time using drools and jrules. As you can see the<br>
difference is a 1,5x factor....so I was wrong... drools is not that<br>
slow. In anycase seems to be slower that jrules.<br>
  <br>
Look at this:<o:p></o:p></span></font></p>
  <div>
  <p class="MsoNormal" style="margin-bottom: 12pt;"><font
 face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
  <a moz-do-not-send="true"
 href="http://blogs.ilog.com/brms/wp-content/uploads/2007/10/jrules-perf-manners.png"
 target="_blank">http://blogs.ilog.com/brms/wp-content/uploads/2007/10/jrules-perf-manners.png</a><o:p></o:p></span></font></p>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;">Massimiliano<o:p></o:p></span></font></p>
  <div>
  <div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><br>
  <br>
  <br>
On 5/15/08, Edson Tirelli &lt;<a moz-do-not-send="true"
 href="mailto:tirelli@post.com">tirelli@post.com</a>&gt;
wrote:<br>
&gt; &nbsp; &nbsp;The old recurring performance evaluation question... :)<br>
&gt;<br>
&gt; &nbsp; &nbsp;You know that an explanation can only be made after having
looked at the<br>
&gt; tests used in the benchmark, the actual rules used by both
products,<br>
&gt; hardware specs, etc... so, not quite sure what answer do you want?<br>
&gt;<br>
&gt; &nbsp; &nbsp;For instance, there are a lot of people that think exactly
the contrary.<br>
&gt; Just one example:<br>
&gt; <a moz-do-not-send="true"
 href="http://blog.athico.com/2007/08/drools-vs-jrules-performance-and-future.html"
 target="_blank">http://blog.athico.com/2007/08/drools-vs-jrules-performance-and-future.html</a><br>
&gt;<br>
&gt; &nbsp; &nbsp;My preferred answer is still:<br>
&gt;<br>
&gt; "In 99% of the applications, the bottleneck is IO: databases,
network, etc.<br>
&gt; So, test your use case with both products, make sure it performs
well<br>
&gt; enough, add to your analysis the products feature set,
expressiveness
power,<br>
&gt; product flexibility, cost, professionals availability, support
quality, etc,<br>
&gt; and choose the one that best fits you."<br>
&gt;<br>
&gt; &nbsp; &nbsp;That is because I'm sure, whatever your rules are, in
whatever product<br>
&gt; you try them, they can be further optimized by having a product
expert<br>
&gt; looking into them. But what is the point?<br>
&gt;<br>
&gt; &nbsp; &nbsp;Cheers,<br>
&gt; &nbsp; &nbsp; &nbsp; Edson<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2008/5/14 mmquelo massi &lt;<a moz-do-not-send="true"
 href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</a>&gt;:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi everybody,<br>
&gt;&gt;<br>
&gt;&gt; I did a benchmark on Drools\Jrules.<br>
&gt;&gt;<br>
&gt;&gt; I found out that drools is about 2,5-3 times slower than
Jrules.<br>
&gt;&gt;<br>
&gt;&gt; How comes?<br>
&gt;&gt;<br>
&gt;&gt; The results I got are quite similar to the ones in:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; <a moz-do-not-send="true"
 href="http://images.google.com/imgres?imgurl=http://blogs.ilog.com/brms/wp-content/uploads/2007/10/jrules-perf-manners.png&amp;imgrefurl=http://blogs.ilog.com/brms/category/jrules/&amp;h=516&amp;w=722&amp;sz=19&amp;hl=it&amp;start=1&amp;um=1&amp;tbnid=YBqwC0nwaSLxwM:&amp;tbnh=100&amp;tbnw=140&amp;prev=/images%3Fq%3Dbrms%2Bbencmark%26um%3D1%26hl%3Dit"
 target="_blank">http://images.google.com/imgres?imgurl=http://blogs.ilog.com/brms/wp-content/uploads/2007/10/jrules-perf-manners.png&amp;imgrefurl=http://blogs.ilog.com/brms/category/jrules/&amp;h=516&amp;w=722&amp;sz=19&amp;hl=it&amp;start=1&amp;um=1&amp;tbnid=YBqwC0nwaSLxwM:&amp;tbnh=100&amp;tbnw=140&amp;prev=/images%3Fq%3Dbrms%2Bbencmark%26um%3D1%26hl%3Dit</a><br>
&gt;&gt;<br>
&gt;&gt; Any explanations?<br>
&gt;&gt;<br>
&gt;&gt; Thank you.<br>
&gt;&gt;<br>
&gt;&gt; Bye<br>
&gt;&gt;<br>
&gt;&gt; Massi<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a moz-do-not-send="true"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Edson Tirelli<br>
&gt; JBoss Drools Core Development<br>
&gt; Office: +55 11 3529-6000<br>
&gt; <st1:City w:st="on"><st1:place w:st="on">Mobile</st1:place></st1:City>:
+55 11 9287-5646<br>
&gt; JBoss, a division of Red Hat @ <a moz-do-not-send="true"
 href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<br>
_______________________________________________<br>
rules-users mailing list<br>
  <a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
  <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-users"
 target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>
  </div>
  </div>
  </div>
  <p class="MsoNormal"><font face="Times New Roman" size="3"><span
 style="font-size: 12pt;"><br>
  <br clear="all">
  <br>
-- <br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
Office: +55 11 3529-6000<br>
  <st1:City w:st="on"><st1:place w:st="on">Mobile</st1:place></st1:City>:
+55 11
9287-5646<br>
JBoss, a division of Red Hat @ <a moz-do-not-send="true"
 href="http://www.jboss.com">www.jboss.com</a>
  <o:p></o:p></span></font></p>
  </div>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>