JIT VS NGEN - 的区别是什么?区别、JIT、VS、NGEN

2023-09-02 11:55:47 作者:炫酷的腿毛

所以,当CLR运行时加载.NET程序集,它编译成机器本土code。这个过程被称为JIT编译。 NGEN也是编译.NET程序集到本地code的过程。我不明白什么是两者之间的区别是什么?

So when CLR runtime load a .NET assembly, it compiles it into machine native code. This process is called JITing. NGen is also the process of compiling .NET assembly into native code. I don't understand what is the difference between two?

推荐答案

所不同的是在的发生。当程序运行时的JIT编译。 NGEN是一个典型的做法在程序的安装时间和发生的程序运行之前。其中一个NGEN的目标是消除来自应用程序的JIT罚启动。

The difference is when they occur. The JIT compilation occurs while your program is running. NGen is a typically done at installation time of your program and happens before your program is run. One of the goals of NGen is to remove the JIT penalty from application start up.