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

Optimize expression processing by removing Expression.Lambda() calls. #32

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

myk0la999
Copy link

@myk0la999 myk0la999 commented Nov 4, 2024

Currently we have a problem with lock contention caused by Expression.Lambda() calls. This MR changes API, to add ability to operate on Expression body and parameters separately for some utils to reduce number of calls to Expression.Lambda().

See: https://dev.miaplaza.com/miaplaza/website/-/issues/16248 (old) and new: https://dev.miaplaza.com/miaplaza/data/-/merge_requests/174

@tb4
Copy link

tb4 commented Nov 18, 2024

@myk0la999 Can you adapt the example for CachedCompileLambda in the readme?

var isEvenDelegate = CachedExpressionCompiler.Instance.CachedCompileLambda(isEvenExpression);

@tb4
Copy link

tb4 commented Nov 19, 2024

Looks good to me now

@myk0la999 myk0la999 force-pushed the optimize_simplify branch 2 times, most recently from 02379a0 to 1a30e70 Compare November 22, 2024 15:28
ExpressionUtils/LambdaParts.cs Outdated Show resolved Hide resolved
@tb4
Copy link

tb4 commented Nov 22, 2024

Looks good to me (only two minor things left)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants