How and when does ngen.exe work?

后端 未结 4 746
旧时难觅i
旧时难觅i 2020-12-08 16:12

I want to know the benefit of pre-JIT compilation (ngen.exe). What is the role of the Native Image Generator (NGen) process and why is it required?

Please provide an

4条回答
  •  孤城傲影
    2020-12-08 16:24

    NGen (Native Image Generator) basically compiles .NET byte code (CIL) into native code for the computer it's running on. The benefit is that given that you're not compiling the code to native every time, you run it or need it, but you do it just once, the application starts and run faster. If you want more information there are plenty of resources out there about the benefits of JIT vs. Ahead of Time Compilation (which is what NGen does).

提交回复
热议问题