We are doing prototyping work on a tool that uses the Jess rule engine. We are following the development model:
Half Jess language scripts, with a substantial amount of Java code providing custom commands and APIs; main() provided by Jess.
We have done some early performance experiments to determine the validity of the approach. We found that the performance was disappointing. (It is competing against ruby scripts that execute all rules over and over until nothing changes.) I think that we should be able to do much better; I am probably making some basic mistakes. A typical performance test (without profiling) running on a G4 (1.42Ghz dual processor) results in the assertion of 136,000 facts in about 25 minutes.
We have looked on the internet and found some advice:
- minimize the number of partial matches generated by rules by putting specific patterns near the top of each rule's LHS (section 3.1 of the Jess Manual)
- put transient patterns near the bottom of each rule's LHS (section 3.1 of the Jess Manual)
- avoid using java code in (test...) statements.
We have also applied a java profiler to get some idea of how time is being spent. It indicated that 99% of the time was spent in definstance. This is a little surprising since only about 1/3 of the facts are shadow facts. So here are some questions:
- Is there a good Jess rule profiler (as opposed to a java profiler)?
- Are shadow facts expensive, particularly if many of the fields in the shadow fact are not needed by Jess?
- Alternatively, is template inheritance expensive? (We only have inheritance for the shadow facts.)
- Is 30ms per definstance good performance?
- Are there guidelines on what type of performance we can expect in running the inference engine over these facts? We are figuring on the order of a couple of hundred rules that will fire100s of thousands of times.
- Is there a way to use focus and the module concept to improve performance (only some of the rules are activated at a time)?
- Is there a sequence that is particularly effective (e.g. assert the facts and then introduce the rules?)
-Timothy
-------------------------------------------------------------------- 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] --------------------------------------------------------------------
