<br> Maxim,<br><br> There is a lot to look for when talking about performance. It is not possible to give you any advice without knowing explicitly what you are doing. It's like SQL: depending one your data model and the way you write your queries, they will perform better or worst.<br>
<br> Just one detail: most of the times, this will reduce your performance: <br><br>conf.setIndexRightBetaMemory(false);<br><div><br></div> Obviously, we expose the configuration because in a few very specific cases, it may improve it. <br>
<br> So, if you really want to discuss how to improve performance, create a self contained test case and present it. Then we have the data to talk about it.<br><br> Edson<br><br><br><div class="gmail_quote">2008/11/20 Maxim Veksler <span dir="ltr"><<a href="mailto:maxim.veksler@gmail.com">maxim.veksler@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 dir="ltr">Hi Joe,<br><br><div class="gmail_quote"><div class="Ih2E3d">On Wed, Nov 19, 2008 at 8:16 PM, Joe White <span dir="ltr"><<a href="mailto:Joe.White@recondotech.com" target="_blank">Joe.White@recondotech.com</a>></span> wrote:<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="EN-US">
<div>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Maxim,</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">Depending on your use case you may be able to disable shadow
facts in your Drools 4 instance. See the manual on when it is ok/not-ok to
disable shadow facts. Based on your description it probably is acceptable for
your uses. Disabling shadow facts may improve your performance, the manual has
details.</span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);">To disable shadow facts:</span></p>
<p style="margin-left: 1.5in;"><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> RuleBaseConfiguration
conf = </span><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(127, 0, 85);">new</span></b><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> RuleBaseConfiguration();</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> </span><span style="font-size: 10pt; font-family: "Courier New";">conf.setShadowProxy(false);</span></p>
<p><span style="font-size: 10pt; font-family: "Courier New"; color: black;"> base = RuleBaseFactory.<i>newRuleBase</i>(conf);</span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
<p><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p></div></div></blockquote></div><div><br>Thank you for the tip, I've added the following flags :<br><br> conf.setShadowProxy(false);<br> conf.setAlphaMemory(false);<br>
conf.setIndexLeftBetaMemory(false);<br> conf.setIndexRightBetaMemory(false);<br><br>and yet I'm seeing performance that are not near what I've been expecting, am I doing something wrong or does drools gives me all that he can :<br>
<br>[maximv@mldev2 ~]$ awk -f awk_avg_ruleEngineFacade.getMatch.awk /var/log/Manager.log<br>avg: 35.9153(ms) for 1027 calls<br><br><br>This is an example of the kind of rules we're using (modified) :<br><br>rule "Context OtherObject"<br>
when<br> $f : FilteringStateConnector($ContextId : ContextId, $subscriberId : subscriberId)<br><br> $subscriber : Subscriber(id == $subscriberId, $subscriberOtherObject : OtherObject, OtherObject != null , OtherObject != "")<br>
$OtherObject : PropertyInstance(type_ == PropertyInstance.OtherObject_PROPERTY_TYPE, code == $subscriberOtherObject) <br> $Context : Context(code == $ContextId, OtherObjects contains $OtherObject)<br><br>then<br>
$f.setPassedRuleRecord("Context OtherObject");<br>end<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
<div link="blue" vlink="purple" lang="EN-US"><div><p><span style="font-size: 11pt; color: rgb(31, 73, 125);"></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 0in 0in;">
<p><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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>] <b>On Behalf Of </b>Maxim Veksler<br>
<b>Sent:</b> Wednesday, November 19, 2008 8:36 AM<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> [rules-users] Drools 4 performs slower then Drools 3 - Help on
.drlfile adaptation</span></p>
</div><div><div></div><div>
<p> </p>
<div>
<p>Hello everyone,<br>
<br>
<br>
Please allow me to briefly describe how our system works:<br>
<br>
We use drools as an efficient matching layers - I have X rules, in the RHS of
each rule I have a mark for each rule to signal that it has passed in the
current context (There are by definition more then 1 contexts). After the first
fireAllRules() has finished, and I have the data structure that allows me to
query what rules have passed for each context I assert a "Marker"
object, that allows Drools to continue filtering only for these contexts that I
decide as valid to match attempts.<br>
<br>
The end result, is that I have 2 fireAllRules called with some java code in
between them.<br>
<br>
<br>
In drools3 for 3 contexts I got the following resutls :<br>
<br>
== Drools Section (Generic Call) : With default context settings, no HotSpot.<br>
RESULT:::::::: avg: 33.9023(ms) for 1555 calls<br>
<br>
Now in drools4 I'm getting the following:<br>
<br>
== Drools Section (Generic Call) : With default context settings, no HotSpot -
Drools 4<br>
RESULT:::::::: avg: 37.4356(ms) for 1467 calls<br>
<br clear="all">
<br>
<br>
As I increase the context's number I'm getting larger difference in results time.<br>
Please note that HotSpot is disabled just for the test, to not JIT
interference.<br>
<br>
I've disabled all evals in the drl files, to all is left is pure Drools syntax
and yet It seems that the system works slower.<br>
<br>
Please suggest what else I should be doing to optimize the drl files to work
efficiently with Drools 4 engine.<br>
<br>
<br>
Thank you,<br>
Maxim.<br>
<br>
-- <br>
Cheers, <br>
Maxim Veksler<br>
<br>
"Free as in Freedom" - Do u GNU ?</p>
</div>
</div></div></div>
</div>
<br></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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><div class="Ih2E3d"><br><br clear="all"><br>-- <br>Cheers, <br>Maxim Veksler<br><br>"Free as in Freedom" - Do u GNU ?<br>
</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><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>