<br>&nbsp;&nbsp; Maxim,<br><br>&nbsp;&nbsp; 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&#39;s like SQL: depending one your data model and the way you write your queries, they will perform better or worst.<br>
<br>&nbsp;&nbsp; Just one detail: most of the times, this will reduce your performance: <br><br>conf.setIndexRightBetaMemory(false);<br><div><br></div>&nbsp;&nbsp; Obviously, we expose the configuration because in a few very specific cases, it may improve it. <br>
<br>&nbsp;&nbsp; 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>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/11/20 Maxim Veksler <span dir="ltr">&lt;<a href="mailto:maxim.veksler@gmail.com">maxim.veksler@gmail.com</a>&gt;</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">&lt;<a href="mailto:Joe.White@recondotech.com" target="_blank">Joe.White@recondotech.com</a>&gt;</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);">&nbsp;</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: &quot;Courier New&quot;; color: black;">&nbsp; RuleBaseConfiguration
conf = </span><b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85);">new</span></b><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> RuleBaseConfiguration();</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"></span></p>




<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">conf.setShadowProxy(false);</span></p>




<p><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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);">&nbsp;</span></p></div></div></blockquote></div><div><br>Thank you for the tip, I&#39;ve added the following flags :<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; conf.setShadowProxy(false);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; conf.setAlphaMemory(false);<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; conf.setIndexLeftBetaMemory(false);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; conf.setIndexRightBetaMemory(false);<br><br>and yet I&#39;m seeing performance that are not near what I&#39;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&#39;re using (modified) :<br><br>rule &quot;Context OtherObject&quot;<br>

when<br>&nbsp;&nbsp;&nbsp; $f : FilteringStateConnector($ContextId : ContextId, $subscriberId : subscriberId)<br><br>&nbsp;&nbsp;&nbsp; $subscriber : Subscriber(id == $subscriberId, $subscriberOtherObject : OtherObject, OtherObject != null , OtherObject != &quot;&quot;)<br>

&nbsp;&nbsp;&nbsp; $OtherObject : PropertyInstance(type_ == PropertyInstance.OtherObject_PROPERTY_TYPE, code == $subscriberOtherObject)&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $Context : Context(code == $ContextId, OtherObjects contains $OtherObject)<br><br>then<br>

&nbsp;&nbsp;&nbsp; $f.setPassedRuleRecord(&quot;Context OtherObject&quot;);<br>end<br><br>&nbsp;</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>&nbsp;</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 &quot;Marker&quot;
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::::::::&nbsp;&nbsp;&nbsp; avg: 33.9023(ms) for 1555 calls<br>
<br>
Now in drools4 I&#39;m getting the following:<br>
<br>
== Drools Section (Generic Call) : With default context settings, no HotSpot -
Drools 4<br>
RESULT::::::::&nbsp;&nbsp;&nbsp; avg: 37.4356(ms) for 1467 calls<br>
<br clear="all">
<br>
<br>
As I increase the context&#39;s number I&#39;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&#39;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>
&quot;Free as in Freedom&quot; - 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>&quot;Free as in Freedom&quot; - 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> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>