JIT vs NGen - what is the difference?

后端 未结 5 2148
青春惊慌失措
青春惊慌失措 2020-12-13 04:35

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 na

5条回答
  •  情深已故
    2020-12-13 05:23

    From MSDN...

    The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead of using the just-in-time (JIT) compiler to compile the original assembly.

    http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=VS.100).aspx

    Basically NGen allows you pre-JIT and cache the assembly on the local machine. This allows for a faster startup and sometimes execution.

提交回复
热议问题