[rules-users] Insert Fact Performance slow with FactType vs Java Pojo

Wolfgang Laun wolfgang.laun at gmail.com
Wed Feb 9 01:55:23 EST 2011


In your application, you can generate Java code for your Txn class and
compile
this; then compile the DRL with your rules. This should give you the
performance
of OPTION 2.
-W

On 9 February 2011 05:29, Saurabh <maheshwari.saurabh03 at gmail.com> wrote:

>
> Hi,
>
>       more detailed Fact problem
>
> ENVIRONMENT:
> My system generates a Txn class on startup based on db config (along with
> rules).
> Then it starts reading the database table, creating instances of this Txn
> class.
> These instances are inserted into the working memory, and fireAllRules
> called for each insertion.
> The number of these instances in memory will grow beyond one million.
> Drools Version is 5.1.1.
>
> OPTION 1:
> Txn is generated as a declared class in DRL and FactType is used to create
> and insert instances.
> I get this to run at 75 TPS which starts slowing down as the number of Txns
> in working memory grows.
> This is too slow for my needs.
>
> OPTION 2:
> I created the Txn as a Java class and used normal new() to create instances
> and insert into the working memory.
> This runs at 1000 TPS steadily all the way to 1.4 millions Txns in memory.
>
> THIS IS ODD, NEED HELP !
> Any ideas ? Option 1 is what we need as the Txn fields change in each run
> configuration.
> Both options work correctly insofar as rule firing is concerned.
> Does not appear to be 'reflection' as it gets worse as the number of
> instances of Txn in working memory increases.
>
> Regards
> Saurabh
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/fact-problem-tp2453010p2456322.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110209/ef6c4759/attachment.html 


More information about the rules-users mailing list