trogon / ketupa-predicates

Parsing library to evaluate predicates
MIT License
0 stars 0 forks source link

Use LambdaExpression to build predicate #31

Open mklemarczyk opened 3 years ago

mklemarczyk commented 3 years ago

Use LambdaExpression that can be compiled into reusable delegate. It is common way how the evaluators are implemented.

mklemarczyk commented 3 years ago

It looks like the LambdaExpression is not a good way to go. The performance on simple tests execution goes bad very fast (about 5x slower).

Screenshot 2021-10-21 235534

mklemarczyk commented 3 years ago

The results can be not realistic as no performance tests are created. More over the failed test takes more time to process than passed test.

mklemarczyk commented 3 years ago

After review of performance the LambdaExpression can be beneficial in high usage cases where predicate is executed more than hundred(s) times a minute. As no type conversion and string parsing is involved.

Implementation will be provided by new class PredicateBuilder.

image