Does the .NET CLR Really Optimize for the Current Processor

前端 未结 7 460
耶瑟儿~
耶瑟儿~ 2020-12-23 10:45

When I read about the performance of JITted languages like C# or Java, authors usually say that they should/could theoretically outperform many native-compiled applications.

7条回答
  •  死守一世寂寞
    2020-12-23 11:34

    I think some Java compilers do, Microsoft .NET doesn't, and it only beats precompiled when you compare apples to oranges. Precompiled can ship with a library variants tuned to different CPUs (or more likely, different instruction sets) and the runtime check to pick which library to load is a lot cheaper than JIT. For example, mplayer does this (google for mplayer enable-runtime-cpudetection).

提交回复
热议问题