<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@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","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Maxim,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>To disable shadow facts:<o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:1.5in;text-autospace:none'><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>  RuleBaseConfiguration
conf = </span><b><span style='font-size:10.0pt;font-family:"Courier New";
color:#7F0055'>new</span></b><span style='font-size:10.0pt;font-family:"Courier New";
color:black'> RuleBaseConfiguration();</span><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";color:black'>                    </span><span
style='font-size:10.0pt;font-family:"Courier New"'>conf.setShadowProxy(false);<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New";
color:black'>                    base = RuleBaseFactory.<i>newRuleBase</i>(conf);</span><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <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<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>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'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'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>
&quot;Free as in Freedom&quot; - Do u GNU ?<o:p></o:p></p>

</div>

</div>

</body>

</html>