1. NGen.exe tool, which can compile the IL code into local code when a program is installed on the user's computer. Since the code has been compiled during installation, the clr jit compiler does not need to compile the IL code at runtime, which helps improve the program performance.
2. NGen.exe can speed up program startup and reduce program working sets. 3. The file generated by NGen.exe has the following problems: 1) There is no intellectual property protection. During runtime, CLR requires access to the Assembly metadata, which requires simultaneous release of the Assembly containing IL code and metadata. 2) The file generated by NGen may be out of sync. The file generated by NGen is applicable to the current execution environment. When you change the previous execution environment, the file generated by NGen cannot be used. 3) Poor execution performance. NGen cannot optimize the final execution environment as the JIT compiler does.