When the .NET CLR c开发者_运维问答ompiles CIL to platform-specific instructions, what does it do if it is compiling on a new CPU architecture (i.e. one it is not familiar with). Is MS keeping ahead of the curve and releasing new, optimized instruction compiling functionality in .NET by cooperating with architecture vendors (Intel, AMD, etc.)??
.Net seems to target architecture families (such as x86, amd64, and ia64) rather than individual architectures. Adding optimization for differing variants and extensions of the three base architecture families is an implementation detail that may or may not improve performance, but is not required to produce running code; these optimizations may be trickled out in point releases, but Microsoft does not appear to be very committed to updating their JIT to get an extra percentage point of speed out of the latest chip.
Edit: It looks like the answer is 'it depends'. The JIT performs some CPU-specific optimizations, but these are only added by Microsoft when they observe clear performance pain points; ahead-of-time compilation with NGen never includes CPU-specific optimization.
精彩评论