-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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);
} |
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: