Open
Description
Related to
- Observing FEC compiled code is 25 percent slower in some cases DryIoc#211
- Fix issue 258 265 DryIoc#268
Currently, FEC has a TryCompileWithPreCreatedClosure
method with limited functionality without nested lambdas support.
We may enable it so that big and deep expressions may skip the closure collection phase improving the performance and saving the memory.
Todo:
- Split constants and nested lambdas into the different arrays in
ArrayClosure
so they could be set independently. It should not affect the memory much because it is just plus one pointer. - Allow to use and share a single closure between the top and nested lambdas. At least for the case without top non-passed parameters used in the nested lambda - which is the majority of cases.
- Decide on how to provide the constant usage to the method OR simplify it away by always storing and loading the closure constants in local variables - considering the multiple usages of one constant to be the most often use-case.
- Keep the same "the same nested lambda compiled once" mechanism via sharing the expression and compiled lambda in
NestedLambdaInfo
.