Skip to content

Improving the performance of Rule Engine #36

Answered by zeroSteiner
sridhar asked this question in Q&A
Discussion options

You must be logged in to vote

I mean rule engine is going to be slower, there's just no way around that. The only thing I see though is that the python expression has an advantage:

If we look at the following. The left side of the 2 and corresponds to the first rule, while the right side corresponds to the second.

if ('first_name' in cond and cond['first_name'] in namelist) and ('val' in cond and cond['val'] in vallist):

Since you have them in Python, it's evaluated as a single expression. If the left side evaluates to false, then the right side is ignored. Rule engine does the same thing, but you have the rules broken out so both rules are always evaluated. A more fair test would be to combine both rule expressions,…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sridhar
Comment options

@sridhar
Comment options

Answer selected by sridhar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants