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

In precompiled operator interceptors, access closure fields via unsafe accessor when possible #33418

Open
Tracked by #34446 ...
roji opened this issue Mar 28, 2024 · 0 comments

Comments

@roji
Copy link
Member

roji commented Mar 28, 2024

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.

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