开发者

The speed of JIT compiling method call compared to reflection in .NET

开发者 https://www.devze.com 2023-01-27 19:05 出处:网络
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 met

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消