JIT instructions of the machine when restarting the program

What happens to the machine code / instructions that are generated by the JIT compiler when the program terminates or restarts. Is JIT compilation repeated? If so, why use this approach?

To simplify the task, I would like to learn specifically about .NET, but for others, answers to other options are welcome

0
source share
1 answer

Is JIT compilation repeated?

Yes, in general.

If so, why use this approach?

Firstly, he avoids questions about where the JIT code should be stored, how much time, etc. In another case, he avoids the code becoming invalid due to someone transferring their hard drive to a machine with a different processor, for example, I suspect that he believes that compiling JIT is a relatively small part of the total time spent for most programs.

Now you can "survive" the assembly using NGen - but there are some optimizations that I believe they cannot do, and again the generated code becomes invalid if you change the CPU, etc.

Also note that the .NET platform itself will run the background service when it is first installed, in order for JIT to compile the framework libraries (which is likely to become the main part of the code launch for most applications). Presumably, he has some skills for recompiling, if necessary ... I never looked at this in too much detail.

+2
source

Source: https://habr.com/ru/post/1440786/


All Articles