Reputation: 23
MSDN: .NET Native is ahead-of-time (“AOT”) compilation: it turns your code into native machine code when you compile
I was wondering how it deals with generics?
Upvotes: 2
Views: 562
Reputation: 1696
There's a feature in that stack called Universal Shared Generics that help catch all the cases where our analysis hasn't properly identified a generic that you need at runtime. For these cases, you won't get optimal speed through that code path as there's a reasonably amount of redirection to get it to work. However, if you discover that a particular hot path is impacted, it's relatively simple to get the compiler to generate native code for those by having some stub code for us to find during analysis that has the desired type signatures.
It's been a part of the .NET Native runtime for some time. You can read about the it in this announcement.
Upvotes: 3