The speed of JIT compiling method call compared to reflection in .NET
Reflection is usually said to be slow. However, when .NET JIT compiler needs to compile a call to a method it needs to refer to the same module metadata tables (if I understand it correctly). Does method (and field) lookup incur the same perf. hit in JIT compilation 开发者_StackOverflowand in reflection?
I think the two might be comparable, but don't forget that JITting is a one-time cost, while using reflection isn't.
精彩评论