Adds functionality to pre-compile rules' conditions in order to speed up evaluation times. Putting it simply: it adds a middleware component that intercepts rules loaded from the data source or being written to the data source, and compiles them to a lambda expression. The resultant lambda expression is stored on the data source, thanks to the new IConditionNode<TConditionType>.Properties dictionary property, which enables to store the compiled lambda expression. This compiled lambda expression is then loaded from the data source avoiding re-compiling the rules' conditions again. This development also includes a conditions eval engine prepared to evaluate compiled rules.
A new project with a Benchmark.Net implementation was already added to measure some performance numbers. Unfortunately, I was unable to assess the improvement of this implementation vs. the master codebase. I'm including the performance numbers taken from the implementation as-is for your consideration.
Description
Adds functionality to pre-compile rules' conditions in order to speed up evaluation times. Putting it simply: it adds a middleware component that intercepts rules loaded from the data source or being written to the data source, and compiles them to a lambda expression. The resultant lambda expression is stored on the data source, thanks to the new
IConditionNode<TConditionType>.Properties
dictionary property, which enables to store the compiled lambda expression. This compiled lambda expression is then loaded from the data source avoiding re-compiling the rules' conditions again. This development also includes a conditions eval engine prepared to evaluate compiled rules.A new project with a Benchmark.Net implementation was already added to measure some performance numbers. Unfortunately, I was unable to assess the improvement of this implementation vs. the
master
codebase. I'm including the performance numbers taken from the implementation as-is for your consideration.Here's how they compare:
Related to #49.
Change checklist
Please also check the I want to contribute guidelines and make sure you have done accordingly.
Disclaimer
By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement