Thursday, May 8, 2014

Operational Decision Management: In-Memory (RetePlus) vs. Input Parameter (RetePlus, Sequential)

IBM Operational Decision Manager (ODM) supports multiple rule execution algorithms: RetePlus, Sequential and Fastpath. We are going to compare test run results of the first two algorithms.

RetePlus Mode:

The default execution mode is RetePlus. Use its optimization techniques to improve performance: reduction of the number of rules and conditions, computation of the rules to execute, and prioritization of the rule order. The RetePlus algorithm operates as follows:
  1. The rule engine matches the conditions of the rules in the ruleset against the objects in working memory. During the pattern matching process, RetePlus creates a network based on semantic relationships between rule condition tests. 
  2. For each match, a rule instance is created and put into the agenda. Then the agenda, based on some ordering principles, selects the rule instance to be executed.
  3. When the rule instance is executed, the rule action is executed.
    This action modifies the working memory in the following ways:
    - By adding a new object to the working memory
    - By removing an object from the working memory
    - By modifying the attributes of an existing object.
  4. The process carries on cyclically until no more rule instances are left in the agenda


Sequential Mode:

The sequential mode executes all the eligible rules for a given rule task in sequence, which provides specific performance advantages. The sequential algorithm operates as follows:

  1. The rule engine performs pattern matching on input ruleset parameters and on the conditions defined on the collections of objects in working memory.
  2. For each match, a rule instance is created and immediately executed. When a rule instance is executed, it sets the value of an attribute or an output ruleset parameter.

Input/output objects can be passed in to the rule engine as ruleset parameters or rules can create and manipulate in-memory objects.

Simple three rules were implemented to compare ruleset execution times for permutations of two execution algorithms and two ways of passing in input objects to the rule engine. Each of the three rules is in a separate ruletask in the ruleflow. Execution times are machine-dependent and therefore, execution time comparison of different algorithms is meaningful only relative to each other. Note that in-memory objects can only run RetePlus.  Below is the execution times chart for the following cases:

  1. Using input parameters and RetePlus algorithm
  2. Using input parameters and Sequential algorithm
  3. Using in memory objects and RetePlus algorithm




Input Size
Using Parameters and
RetePlus Algorithm
 (time in seconds)
Using Parameters and
Sequential Algorithm
(time in seconds)
Using in Memory Objects and
 RetePlus Algorithm
(time in seconds)
 Number of Rules
Fired
1000
3
3
3
400
2000
6
6
6
800
3000
11
11
11
1200
4000
16
16
17
1600
5000
24
23
24
2000
6000
32
31
32
2400
7000
43
43
44
2800
8000
53
53
58
3200
9000
65
66
72
3600



To improve the performance of RetePlus algorithm you can do one of the following:                              (Click here for details)
  • Optimize the object model
  • Optimize with optimize method 
  • Optimize with static agenda
  • Activate dynamic rule compilation
  • Improve the performance of equality and/or comparison evaluation 

To improve the performance of Sequential algorithm you can try: 
  • Memory consumption reduction


Artur Sahakyan is an Associate Consultant at Prolifics specializing in IBM WebSphere Operational Decision Management (v5.xx - v8.xx). Artur has a strong background in mathematics and probability/statistics. He also has profound knowledge of IBM Business Process Manager, IBM Integration Bus (IIB v9), IBM WebSphere MQ (v7), IBM SPSS Modeler, IBM SPSS Statistics, Java, C++, C.