[rules-users] Time Taken To Load Rule Resource

Adeyinka Timi adeyinka.timi at nathean.com
Tue May 18 06:41:57 EDT 2010


May I add that the .pkg file was created successfully.

 

Adeyinka Timi | Technical Supprt | Nathean Technologies Ltd

Registered Office 3 Lyncon Court, IDA Science & Technology Park, Snugborough
Road, Blanchardstown, Dublin 15, Ireland
T +353 1 685 3001 | VOIP 076 615 1117 | E adeyinka.timi at nathean.com |
<http://www.nathean.com/>  <http://www.nathean.com> www.nathean.com

Incorporated in Ireland, No. 339972

The information appearing in this email and any files transmitted with it is
confidential and may not be reproduced, modified, distributed, transmitted,
displayed, published or broadcast without the prior written permission of
Nathean Technologies Ltd. It is intended solely for the use of the
addressee(s). Nathean Technologies Ltd, its directors, officers and
employees do not accept liability for any loss or damage of any nature
howsoever arising pertaining to the use of information appearing in this
email and/or any files transmitted with it. Whilst this email has been
checked for the presence of computer viruses, Nathean Technologies Ltd does
not, except as required by law, represent, warrant and/or guarantee that the
integrity of this communication has been maintained nor that the
communication is free of errors, viruses, interception or interference.

  _____  

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Adeyinka Timi
Sent: 18 May 2010 11:36
To: 'Rules Users List'
Subject: Re: [rules-users] Time Taken To Load Rule Resource

 

Hi,

 

Thanks for the help!

 

I have tried implemented your idea by creating a method that compiles the
rules resources (DRL and RF files). But I keep getting a 

 

java.lang.RuntimeException: java.io.EOFException 

 

error when I call
kbuilder.add(ResourceFactory.newFileResource("/some/file.pkg"),
ResourceType.PKG); 

 

Any ideas?

 

- Ade

  _____  

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Esteban Aliverti
Sent: 17 May 2010 14:32
To: Rules Users List
Subject: Re: [rules-users] Time Taken To Load Rule Resource

 

Yes, you can compile your rules once and save them as binary files. Here is
a code snippet to do that:

 

                KnowledgePackage pkg = (KnowledgePackage) kbuilder
.getKnowledgePackages().iterator().next();

                FileOutputStream out = new
FileOutputStream("/some/file.pkg");

                        try {

                                    DroolsStreamUtils.streamOut(out, pkg);

                        } finally {

                                    out.close();

                        }

 

The code above only uses kbuilder's first package.

The way you load a binary package is the same as you do for DRL files:

 

 
kbuilder.add(ResourceFactory.newFileResource("/some/file.pkg",
ResourceType.PKG); 

 

Hope you find this useful!

 

Best,

 

2010/5/17 Adeyinka Timi <adeyinka.timi at nathean.com>

Thanks for your reply!

No particular reason. Is there a better of going about this - avoid
compilation of rules everytime?

 

  _____  

From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Esteban Aliverti
Sent: 17 May 2010 14:09
To: Rules Users List
Subject: Re: [rules-users] Time Taken To Load Rule Resource

 

Is there any reason why you need to compile the rules every time your app
starts? 

2010/5/17 Adeyinka Timi <adeyinka.timi at nathean.com>

Hi guys,

 

I have a drools application running that takes about 7 seconds to run. 5
seconds of this time is used in parsing 2 DRL files that 200kb (6200 lines
of code) and 34kb (1400 lines of code). Do you guys have any tips or any
techniques that I can use to improve performance?

 

 

- Ade


_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti


_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100518/13517ef0/attachment.html 


More information about the rules-users mailing list