dadhi / dadhi/FastExpressionCompiler

Support compilation without closure collection phase for expression with nested lambdas

Open
#250 1 comment 0 reactions 0 assignees View on GitHub
idea performance
Dominant language
C#
Stars
1.4k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Related to
- https://github.com/dadhi/DryIoc/issues/211
- https://github.com/dadhi/DryIoc/pull/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`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.