Optimize the performance of evaluation part of rule sets
by saubhagya for Drupal
Rule is an event driven module. According to event if specified conditions of the are met the corresponding actions are taken. Rule sets are sets of rules. Rules of rule sets can be interrelated in their condition part (containing same conditions or their negations). So the same condition generally be evaluated multiple times. This approach is not optimal. We can optimize this by changing the condition evaluation part in the form of a decision tree. Every condition will be evaluated at max one.