CLR Language optimization. Language Compiler VS JIT Compiler
Release IS NOT Debug: 64bit Optimizations and C# Method Inlining in Release Build Call开发者_运维知识库 Stacks
Scott Haselman says "most of the optimizations in managed code are done by the JIT compiler rather than the language compiler." in upper post.
I think, 'JIT compile time' seems like 'Run Time', so JIT compile time optimization can make a program slow. But he says it is opposite. Do you know why the CLR optimization works like this?
So yes, it is slower, and it is also faster. A initial run of a CLR function will be slower than a native routine, since it takes time for a JIT compiler to compile the function to machine code. However on subsequent runs the code could actually be faster since the JIT compiler knows more about the application than an AOT (ahead-of-time) compiler does.
For instance, a JIT compiler may enable SSE extensions on a supported processor.
精彩评论