Repository navigation
Evaluate captured values without compiling; cache row readers by shape - #883
Conversation
Thorium
commented
Nov 19, 2026
- Patterns.evaluateExpression reads a query's one-off values (constants, members, method calls on captured values, conversions, quotes) by reflection and interprets the rest, in place of Expression.Lambda(e).Compile().
- QueryExpression.CompiledLambdas compiles a row reader once per shape and binds each run's constants into it. Not used where the runtime interprets lambdas (IsDynamicCodeSupported false).
- Exceptions from a captured value are raised unwrapped.
- Patterns.evaluateExpression reads a query's one-off values (constants, members, method calls on captured values, conversions, quotes) by reflection and interprets the rest, in place of Expression.Lambda(e).Compile(). - QueryExpression.CompiledLambdas compiles a row reader once per shape and binds each run's constants into it. Not used where the runtime interprets lambdas (IsDynamicCodeSupported false). - Exceptions from a captured value are raised unwrapped.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
🟡 Changes recommended
Two critical cache-key defects remain: member mappings in NewExpression projections and declared lambda parameter order are omitted or misrepresented, allowing distinct expressions to reuse the wrong compiled factory.
2 open issues
Review effort: Lite
# Conflicts: # docs/RELEASE_NOTES.md # tests/SqlProvider.Tests/SqlProvider.Tests.fsproj
|
|
||
| /// The lambda's delegate, from the factory compiled for its shape; a lambda the shape doesn't describe is compiled alone. | ||
| let internal compile (lambda: LambdaExpression) : Delegate = | ||
| if not compilesToIL then lambda.Compile() |
There was a problem hiding this comment.
On modern .NET the plain Compile() already chooses the interpreter itself when dynamic code is not supported.
