Very slow execution of Rule Engine (Dictionary)

If the rule dictionary is large (let’s say 5 thousands rule conditions), then the Rule Engine (Dictionary) becomes very slow as it checks all of the conditions as in ifs instead of else ifs or elifs. Is there any way to avoid this?

Hi @soumyabg,
the node description hints that the rules are only tested until the first one matches:

The first matching rule in order of definition determines the outcome

With that in mind, can you reorder the rules so that the frequently used rules will be on top? If that’s not enough, please tell us more about your problem. Maybe we can cook up something structurally different that does the same job.

Happy New Year, T

@soumyabg I have not tried it with rules but you should be able to save them as PMML and apply that.

You could try to compile the pmml rules

And then use the compiled version. This might be faster.

Might depend on how complicated the rules might be. And if they are supported.

3 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.