Replies: 3 comments
-
Hi @dadhi, the library was first created in 2014 to kind of support something like Expression.Compile() in Xamarin.iOS projects. Back then the The statement about it beeing slow refers to the heavy use of reflection. Your interest in this library made myself curious how it performs compared to other approches. I will create a little benchmark to see whats going on. Thank you for reaching out. |
Beta Was this translation helpful? Give feedback.
-
As expected the
There is obviously much room for performance improvements. :-D |
Beta Was this translation helpful? Give feedback.
-
Yep. Thanks for checking. I think to get the general idea about target performance you may compare a bare reflection call to get the property. The difference between it and the Reflect is the cost of the library abstraction, which need to be cut to get this perf. Besides, in principle there are ways to improve the perf beyond the reflection, e.g. often user may know the parts of the expression, so it possible to recognize those parts while traversing the expression and call those known methods and properties directly. It may be configured in the Reflect via rules set by user. There are may be some caching or sub-result memoization approaches as well. I mean, the interpretation is indeed slower than compiled invocation but is not necessary too slow. Especially taken into account the cast of the compilation itself when starting up. |
Beta Was this translation helpful? Give feedback.
-
Hi @mgernand @seesharper,
Really interesting project as it tries to cover most of the expressions.
I am doing something like this myself for DryIoc project but with limited number of expressions, so decided to looked here to find if I can steal something :-)
Couple of questions (maybe obvious ones):
Expression.Compile(preferInterpretation: true)
Btw. Maybe it makes sense to enable Discussions section in the repo to avoid polluting the issues. Fill free to move my issue there if/when enabled.
Beta Was this translation helpful? Give feedback.
All reactions