<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&#39;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&#39;m serious about the beer... ;) run and share the results with us... <br><br><br><div class="gmail_quote">2008/5/15 mmquelo massi &lt;<a href="mailto:mmquelo@gmail.com">mmquelo@gmail.com</a>&gt;:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You r right...<br>
<br>
I have to tell you what I have done...<br>
<br>
I did not define a &quot;stand-alone&quot; benchmark like the &quot;Manners&quot; 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 &quot;bres&quot; 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 &quot;switch the<br>
rule engine&quot; 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 Derby.<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>
&quot;Eval(...)&quot; blocks in the Drools version I did not use the &quot;Eval()&quot; 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:<br>
<div class="Ih2E3d"><br>
<a 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><br>
<br>
</div>Massimiliano<br>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On 5/15/08, Edson Tirelli &lt;<a 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 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; &quot;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.&quot;<br>
&gt;<br>
&gt; &nbsp; &nbsp;That is because I&#39;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 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 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 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a 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; Mobile: +55 11 9287-5646<br>
&gt; JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
&gt;<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>