You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In precompiled queries, we generate interceptors for LINQ query operators that need to extract evaluatable fragments of the query tree as parameters; this is currently done via the LINQ expression tree interpreter, which has an overhead. We have to do that for complex evaluatable fragments (e.g. binary expression composed on top of a captured variable), but when the fragment is a simple captured variable (nothing composed on top) the overhead of the interpretor can be done away with.
In the short term, we can generate code that does reflection to read the field from the closure type (i.e. the DisplayClass). But in the future, we should even be able to generate an unsafe accessor that allows us to efficiently access that field without reflection as well.
In precompiled queries, we generate interceptors for LINQ query operators that need to extract evaluatable fragments of the query tree as parameters; this is currently done via the LINQ expression tree interpreter, which has an overhead. We have to do that for complex evaluatable fragments (e.g. binary expression composed on top of a captured variable), but when the fragment is a simple captured variable (nothing composed on top) the overhead of the interpretor can be done away with.
In the short term, we can generate code that does reflection to read the field from the closure type (i.e. the DisplayClass). But in the future, we should even be able to generate an unsafe accessor that allows us to efficiently access that field without reflection as well.
See dotnet/runtime#90081 (comment) for more context.
The text was updated successfully, but these errors were encountered: