I think Noah Zimmerman wrote: > Hello! > > I would like to run some tests with my existing rule base to check the > performance under different conditions. My understanding of the Rete > algorithm is that its efficiency is inversely proportional to the number > of changes in the knowledge base.
That's pretty oversimplified, really. If you modify a fact which isn't pattern-matched by any rule, then it's basically free; if you modify a fact which is matched at the top of many rules in many combinations, modifying that fact can take a lot of time. There's an expanded analysis of Jess's performance in chapter 8 of "Jess in Action." > With this in mind, I would like to > see the degradation of performance as an increasing number of facts are > modified/retracted/asserted. I was wondering what the best practice was > for doing these kind of speed benchmarks. This code will be embedded in > a Java application which is responsible for altering the knowledge base. > I would like to see the time for each iteration of the loop, as well as > the overall elapsed time. See below for one approach. Is there a way isolate just the JESS > performance to separate it from the Java execution? Forgive me naivety, If by "the Java execution" you mean your driver program, sure, yes -- only time the calls to Jess, not your own code. If you mean separating Jess's Java code from the Jess language code -- they're not separable, they're one and the same. > I have never tried to do speed testing before! ( When I tried to do > something like: > ( bind ?last-time ?time ) > DO OTHER THINGS > ( bind ?time ( time ) ) > ( bind ?eTime ( - ?time ?last-time ) ) > I only got values of 0 and 1 ) That's because the code you're benchmarking is too fast to measure; you can run it in a loop to make it take long enough to get good numbers. Several of the example programs in the JessXX/examples directory are set up as benchmarks this way; see the "run-n-times" function near the bottom of examples/fullmab.clp, for example. --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- 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] --------------------------------------------------------------------
