JIT compiler vs offline compilers

后端 未结 11 1129
醉酒成梦
醉酒成梦 2020-11-28 05:39

Are there scenarios where JIT compiler is faster than other compilers like C++?

Do you think in the future JIT compiler will just see minor optimizations, features b

11条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 06:37

    Yes, JIT compilers can produce faster Machine Code optimized for the current environment. But practically VM programs are slower than Native programs because JITing itself consumes time (more Optimization == more time), and for many methods JITing them may consume more time than executing them. And that's why GAC is introduced in .NET

    A side effect for JITing is large memory consumption. However that's not related to computation speed, it may slow down the whole program execution, because large memory consumption increases the probability that your code will be paged out to the secondary storage.

    Excuse me for my bad English.

提交回复
热议问题