ILOG JRules User Guide > Optimizing Execution > Concepts > Performance Optimizers

ILOG JRules includes the following performance optimization techniques.

RetePlus, Sequential, and Fastpath Execution Modes

JRules high-performance rule engine implements a RetePlus execution mode designed to optimize the evaluation of a large number of rules across a large number of objects. The RetePlus execution mode allows tests to be filtered such that irrelevant tests do not need to be evaluated. Tests can be shared between rules that use similar tests so that the they do not need to be re-evaluated for all the rules. RetePlus is the default execution mode.

Sequential processing implements stateless pattern matching compared with the incremental and stateful nature of the RetePlus execution mode. It is possible to significantly improve the speed of rule processing using the sequential execution mode. The performance of an engine will improve using the sequential execution mode if it is provided with a large ruleset made of basic but test-intensive rules with static priorities.

The Fastpath execution mode combines the advantages of RetePlus and sequential processing. It can operate like the sequential execution mode, efficiently matching objects against a large number of rules that individually perform simple discriminations or join tests. However, it can operate like the RetePlus with tests and loops. The Fastpath execution mode uses the relations that exist between the tests to structurally organize code instead of a simpler version that would reuse test values that were previously computed.

Using From and In Building Blocks

Rules can also be internally rewritten by the engine to enable automatic optimization of the rules. Using the from and in building blocks reduces the number of objects on which pattern matching is done, and hence the number of evaluations carried out. The rule engine will automatically rewrite rules to use these building blocks whenever possible. For details see Extending Objects Available for a Condition.

Dynamic Bytecode Generation

ILOG JRules supports dynamic bytecode generation to speed up the evaluation of the tests for rules in RetePlus execution mode. Rule tests can be translated directly into Java bytecode and integrated into the application to improve performance of the rules. Depending upon the rules, bytecode generation can improve processing performance of the engine by a factor ranging from 4 to more than 10 by bypassing Java introspection. The generated bytecode calls Java members directly in the rule tests, and so the more complex the rules and the more objects there are in working memory, the bigger the gain. Dynamic bytecode generation also reduces the activity of the garbage collector at run time, thereby enhancing performance.

Rule Engine Configuration

It is also possible to request the following additional optimization options to be turned on using a rule engine configuration file:

Related Concepts

Performance and Scalability
Applications and ILOG JRules Performance
Java and ILOG JRules
The Configuration Resource File

Related Tasks

Writing Technical Rules
Setting Rule Engine Configuration Properties
Improving RetePlus Execution Mode Performance
Improving Sequential Execution Mode Performance
Improving Fastpath Algorithm Performance
Improving Equality Test Evaluation Performance
Instrumenting Join Tests with Finders
Running Several Rule Engines in Parallel
Executing a Rule Task Directly

Related Reference

Rule Engine Configuration Properties