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

Change IL Emit invoke path to use function pointers and OpCodes.Calli #75357

Open
Tracked by #75358
steveharter opened this issue Sep 9, 2022 · 1 comment
Open
Tracked by #75358
Assignees
Labels
area-System.Reflection Cost:S Work that requires one engineer up to 1 week tenet-performance Performance related issue
Milestone

Comments

@steveharter
Copy link
Member

Currently, the invoke fast-path generates IL using either call or callvirt. If this is changed to use calli and function pointers, it is possible to cache the generated dynamic method and use it for all such calls to the same signature. This reduces the memory footprint and makes calling subsequent but different methods faster since there would essentially be a hashtable look upon the signature instead of generating a new method.

In addition, it will be used to support invoke against a function pointer via #75347.

Items to consider:

  • Sharing of instance methods across different reference Types.
  • Virtual functions (see ldvirtftn).
@steveharter steveharter added this to the 8.0.0 milestone Sep 9, 2022
@steveharter steveharter self-assigned this Sep 9, 2022
@ghost
Copy link

ghost commented Sep 9, 2022

Tagging subscribers to this area: @dotnet/area-system-reflection
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently, the invoke fast-path generates IL using either call or callvirt. If this is changed to use calli and function pointers, it is possible to cache the generated dynamic method and use it for all such calls to the same signature. This reduces the memory footprint and makes calling subsequent but different methods faster since there would essentially be a hashtable look upon the signature instead of generating a new method.

In addition, it will be used to support invoke against a function pointer via #75347.

Items to consider:

  • Sharing of instance methods across different reference Types.
  • Virtual functions (see ldvirtftn).
Author: steveharter
Assignees: steveharter
Labels:

area-System.Reflection, tenet-performance

Milestone: 8.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Reflection Cost:S Work that requires one engineer up to 1 week tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

1 participant