Fast and Light Functions
typeof
Object.GetType
typeof == Object.GetType
Type equivalence APIs (including typehandle operator overloads)
get_Module
get_MemberType
Some of the IsXX predicate APIs
New token/handle resolution APIs in the .NET Framework 2.0
Costly Functions
GetXX APIs (MethodInfo, PropertyInfo, FieldInfo, and so on)
GetCustomAttributes
Type.InvokeMember
Invoke APIs (MethodInfo.Invoke, FieldInfo.GetValue, and so on)
get_Name (Name property)
Activator.CreateInstance
Give a look at http://msdn.microsoft.com/en-us/magazine/cc163759.aspx
to have much more details on :
- When to use reflection,
- Early-Bound, Hybrid-bound and Late-Bound Invocation,
- the MemberInfo cache,
...
Aucun commentaire:
Publier un commentaire