Skip to content

Tiered compilation support for dynamic methods #73594

Open

Description

@gdkchan

Description

A few years ago, tiered compilation was introduced on .NET. However, at least to my knowledge, it was never supported for dynamic methods. Having tiered compilation for dynamic methods would provide the same benefits it does for "pre-compiled" applications, faster startup when you have a lot of code that only needs to run once (and so the JIT optimizations might not pay off if it spends more time compiling the code than actually running it).

In the past I made emulators that translate machine code to .NET IL. One of the problems was that the JIT was quite slow, and at the time tiered compilation was not implemented. Some guest applications could take up to a few minutes to start due to the JIT cost, among other issues. Tiered compilation could improve that, and generally improve applications that needs to generate large amounts of dynamic methods.

It might be worth exposing some API to allow passing some hint to the JIT about the preferred compilation strategy for the dynamic method (like tiered, optimizations disabled or all optimizations). Personally I would be fine just getting tiered compilation for all dynamic methods, but maybe in some cases that's not desirable, so having the choice would be better.

Activity

  1. added
    tenet-performance
    on Aug 8, 2022
  2. ghost added
    untriaged
    on Aug 8, 2022
  3. removed
    untriaged
    on Aug 10, 2022
  4. added this to the Future milestone on Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions