Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize memory consumed by FEC.LightExpression.Expression #116

Closed
dadhi opened this issue Aug 29, 2018 · 9 comments
Closed

Minimize memory consumed by FEC.LightExpression.Expression #116

dadhi opened this issue Aug 29, 2018 · 9 comments
Assignees
Milestone

Comments

@dadhi
Copy link
Owner

dadhi commented Aug 29, 2018

The expression with multiple sub-expressions like Expression.Call contain their arguments in array.

We may provide overloads with separate 1, 2, 3, 4, 5, or more arguments, and store them not in array but inlined.

If we futher make some expressions into a struct, e.g. ParameterExpression we can gain an additional savings.

@dadhi dadhi changed the title Minimize memory consumed FEC.LightExpression.Expression Minimize memory consumed by FEC.LightExpression.Expression Aug 29, 2018
@dzmitry-lahoda
Copy link
Contributor

What way contributor may check that his changes do good in terms of performance? Could it be running all tests as part of specific bench? As of now I do not know how to do it.

@dzmitry-lahoda
Copy link
Contributor

Using stucts may lead to the case when in parameters and ref returns may be appear best way to work with them. But in this case code for LINQ and FEC expressions may be different.

@dzmitry-lahoda
Copy link
Contributor

Another alternative to have limit number of params to 255 #89 and pass small array by ref and call it with by ref return. So we may store items in most optimal array instead doing overloads.

@dadhi
Copy link
Owner Author

dadhi commented Aug 30, 2018

@dzmitry-lahoda I will review #89, thanks for reminder

@dadhi
Copy link
Owner Author

dadhi commented Aug 30, 2018

Another thing what is bothering me is that FEC almost always has a Gen1, Gen2 allocations vs Expression.Compile does not. Check the benchmarks in #72.

@dadhi
Copy link
Owner Author

dadhi commented Feb 20, 2019

We may provide overloads with separate 1, 2, 3, 4, 5, or more arguments, and store them not in array but inlined.

It is still an actual thing to look at.

@dadhi dadhi added this to the 2.1.0 milestone Feb 20, 2019
@dadhi dadhi removed the idea label Feb 20, 2019
@dadhi dadhi modified the milestones: 2.1.0, 3.0.0 Sep 10, 2019
@dadhi
Copy link
Owner Author

dadhi commented Jun 7, 2020

Added specialized versions for the few arguments.

@dadhi
Copy link
Owner Author

dadhi commented Jul 16, 2020

todo:

  • InvocationExpression

@dadhi dadhi self-assigned this Aug 10, 2020
@dadhi dadhi removed the help wanted label Aug 10, 2020
@dadhi
Copy link
Owner Author

dadhi commented Aug 10, 2020

The work is completed for all major expressions, the remaining are Switch, TryCatch and Loop can be tackled separately when time permits or with contributions.

@dadhi dadhi closed this as completed Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants