In your application, you can generate Java code for your Txn class and compile<br>this; then compile the DRL with your rules. This should give you the performance<br>of OPTION 2.<br>-W<br><br><div class="gmail_quote">On 9 February 2011 05:29, Saurabh <span dir="ltr">&lt;<a href="mailto:maheshwari.saurabh03@gmail.com">maheshwari.saurabh03@gmail.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;"><br>
Hi,<br>
<br>
       more detailed Fact problem<br>
<br>
ENVIRONMENT:<br>
My system generates a Txn class on startup based on db config (along with<br>
rules).<br>
Then it starts reading the database table, creating instances of this Txn<br>
class.<br>
These instances are inserted into the working memory, and fireAllRules<br>
called for each insertion.<br>
The number of these instances in memory will grow beyond one million.<br>
Drools Version is 5.1.1.<br>
<br>
OPTION 1:<br>
Txn is generated as a declared class in DRL and FactType is used to create<br>
and insert instances.<br>
I get this to run at 75 TPS which starts slowing down as the number of Txns<br>
in working memory grows.<br>
This is too slow for my needs.<br>
<br>
OPTION 2:<br>
I created the Txn as a Java class and used normal new() to create instances<br>
and insert into the working memory.<br>
This runs at 1000 TPS steadily all the way to 1.4 millions Txns in memory.<br>
<br>
THIS IS ODD, NEED HELP !<br>
Any ideas ? Option 1 is what we need as the Txn fields change in each run<br>
configuration.<br>
Both options work correctly insofar as rule firing is concerned.<br>
Does not appear to be &#39;reflection&#39; as it gets worse as the number of<br>
instances of Txn in working memory increases.<br>
<br>
Regards<br>
Saurabh<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/fact-problem-tp2453010p2456322.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/fact-problem-tp2453010p2456322.html</a><br>

Sent from the Drools - User mailing list archive at Nabble.com.<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>
</font></blockquote></div><br>