Skip to content

optimize trigger condition evaluation

Sandor Semsey requested to merge (removed):optimize_rule_condition_check into master

This is small optimization to only evaluate a trigger condition if it's result is relevant.

Like:

  • previous condition was evaluated false, this condition is linked with AND => no need to check, result will be false anyway
  • similarly with OR: if previous condition is true, skip evaluation

This way you can organize your conditions to move forward the quick & cheap ones, so the more expensive ones will be checked later, and maybe they won't be needed to run.

Mostly, this means only a minor performance gain, but I can think of use cases when this could matter.

Note: this gives no grouping of conditions, i.e. there's many AND conditions all false (or one of them), but last condition is linked with OR, it will be evaluated and total result will depend on that condition.

Merge request reports

Loading