-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Jit] Proposal: Non-shared generics #9682
Comments
Would it perhaps be worthwhile for the attribute to take a list of types that generic specialization for reference types would be valid for (ex: I could imagine there being cases where you only want to specialize a handful of types and you want everything else to take the same code-path (such as if other types are unsupported)... |
Makes sense; something like? public class GenericSpecializationAttribute : Attribute
{
public GenericSpecializationAttribute();
public GenericSpecializationAttribute(params Type[] types);
} |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
This issue will now be closed since it had been marked |
Proposal
If you had for example aspnet/KestrelHttpServer#2290
and you marked it with this
MethodImplOptions.NonSharedGeneric
it would elide all the type checks forclass
es/interface
s as it does forstruct
s meaning it would turn into a branchless function (and create an implementation for everyTFeature
type it was called with).Still performance issues with it being an interface generic method
IFeatureCollection.Get<TFeature>()
; but better performance...The text was updated successfully, but these errors were encountered: