3 ms·
What would really make reflection fast is the dual operation of typeof(T) -> Type, that is, Type -> T. Then you can do all kinds of neat but efficient things b
by naasking 10y ago
What would really make reflection fast is the dual operation of typeof(T) -> Type, that is, Type -> T.
Then you can do all kinds of neat but efficient things by exploiting the CLR's runtime generics [1]. This is something that would be easily done in the CLR itself, a sort of hidden universal method that could perform a single, maybe double, dispatch into the correct generic overload, but alas, we are left only to simulate this using poor imitations of inline caches.
[1] https://github.com/naasking/Dynamics.NET https://github.com/naasking/Dynamics.NET
- matthewwarren 10y agoCool, Dynamics.NET look like a cool library, I'd not heard of it before, thanks