Hi Dheeraj,

Remember that Jess's working memory is like a database, in that it is
indexed for fast retrieval. When you define a set of rules, you're
also simultaneously defining the indexes that the "database" will
use. When you put information into the databse via assert or
definstance, the indexes are built. Not everyone new to Jess realizes
this: (assert), (retract), (modify), (definstance) and (undefinstance)
are expensive, precisely so that (run) is very cheap. Once the
database is populated, choosing which rule to fire next becomes
essentially free.

Anyway, as you can imagine, then, the nature of your rulebase has a
very strong influence on the time it takes to do a
(definstance). Section 3.2 of the Jess manual has a few words of
wisdom that might get you started at optimizing your rule base. You
don't say how anything about your computer, RAM size, Java version,
Jess version, or rulebase size, but 38,000x4 definstances in one hour
is an average of 42 per second. See if you can do INSERTs to your
database at that rate, with primary and secondary keys on each
table. And commit each one as you go!

If you're adding the same 38,000 to 4 Rete objects, you might consider
seeing if using clone() on one object would be faster. 

Regarding how Jess stacks up against other rule engines, the Haley
manners benchmark notwithstanding, here's an independent test of a
number of popular rule engines on the "manners" benchmark. Jess 6
(actually in early alpha at that point) comes out in the middle of the
pack -- not bad considering that many of the entries are not
Java-based. There's an interesting discussion of the "JRULES-OPT"
result which you can also find in the archive.

http://www.mail-archive.com/[email protected]/msg03278.html

I think Dheeraj Kakar wrote:
> Hi all,
> 
> Is there any source for performance numbers of jess. As part of my 
> program I am adding about 38,000 beans to 4 instances of rete running in 
> 4 threads. Just this part takes the better part of an hour. Of course I 
> am making database connections and populating these beans and so on; but 
> if I comment out the definstance it drops to ~4 min. Does this 
> definstance time sound unusually high?
> 
> Thanks
> Dheeraj
> 




---------------------------------------------------------
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