1. Improving Drools Memory Performance

Here are various notes I’ve collected from developing a large ruleset in Drools in order to improve performance.

  1. Using the == operator over equals() is recommended as this allows for hashing to mprove performance (link)
  2. Nested accessors are much slower than direct field access, e.g. age > $p.children[0].age (link)
  3. “StatelessSessions also support sequential mode, which is a special optimised mode that uses less memory and executes faster”
  4. Factor out code from the rule body; i.e., the rule bodies should be as small as possible (link)