Hi Gavin,

Note that what takes a long time isn't the actual parsing of the text,
but the compiling of the rule network. Building the Rete net out of
the rule descriptions is a lot of computational work. If you've got
some deffacts and a (reset) command in the batch file, then that's all
the pattern-matching work right there, too.

The time it takes to load rules is a concern I've tried to address in
the past and intend to address again in Jess 6. The (bload) and
(bsave) commands were intended to help here. They use Java
serialization to write out essentially just the Rete network and
supporting structures. Unfortunately, Java serialization is so slow
that (bload)-ing in a large set of rules takes a little longer than
recompiling them from scratch, so there isn't much point to using
these commands.

Anyway, I've been thinking that bload and bsave could be rewritten to
use some more efficient encoding than Java serialization; or
similarly, I could add Externalization routines to some key Jess
classes (Externalization being the main way you can speed up
Serialization.) But this work hasn't been done yet.

The only suggestion of any real value I can make to you right now
would be to load the rules in a separate thread, so you can have
something else going on concurrently in your program.

I think Gavin Nunns wrote:
> Hi
> 
> I have discovered that when using Jess embedded into Java programs, if you 
> are loading the rules from a .clp file using the batch command.  And these 
> files contain a large number of rules and are quite sizable they can take a 
> noticeably long time to load in.
> 
> I was wondering if there was a faster way of doing this.  Could the rules be 
> held in a data file or database then retrieved on program load and sent as a 
> parsable text to the Jess rule engine that way.
> 
> Or is it just a case of minimising the number and size of rules through 
> efficient coding.
> 
> Any Ideas or thoughts are much appreciated.
> 
> Gavin Nunns
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list (use your own address!) List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to