zzzprojects / EntityFramework.DynamicFilters

Global filtering for Entity Framework.
https://entityframework-dynamicfilters.net/
MIT License
501 stars 87 forks source link

Optimize removal of filter disabled conditions #163

Closed TobiasMarklund closed 4 years ago

TobiasMarklund commented 4 years ago

Profiling our db code, we saw a hotspot in the '''RemoveFilterDisabledConditionFromQuery''' method. There are a few optimizations able to be made here:

Benchmarks on EF-generated command strings from our product yields somewhere between 10-100x time improvement for this method over original code. Memory allocations may cause few KB more allocations on very small queries, but saves several megabytes on large queries with many replacements.

JonathanMagnan commented 4 years ago

Thank you @TobiasMarklund for your pull,

we will try to review it during the weekend and release it if accepted.

Best Regards,

Jonathan


Performance Libraries context.BulkInsert(list, options => options.BatchSize = 1000); Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation Eval.Execute("x + y", new {x = 1, y = 2}); // return 3 C# Eval FunctionSQL Eval Function

JonathanMagnan commented 4 years ago

Hello @TobiasMarklund ,

Thank you for your contribution.

The v3.1.1 has been released. It includes your both pull requests.