What does a just-in-time (JIT) compiler do?

后端 未结 18 1980
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 12:42

What does a JIT compiler specifically do as opposed to a non-JIT compiler? Can someone give a succinct and easy to understand description?

18条回答
  •  春和景丽
    2020-11-22 12:58

    JIT stands for Just-in-Time which means that code gets compiled when it is needed, not before runtime.

    This is beneficial because the compiler can generate code that is optimised for your particular machine. A static compiler, like your average C compiler, will compile all of the code on to executable code on the developer's machine. Hence the compiler will perform optimisations based on some assumptions. It can compile more slowly and do more optimisations because it is not slowing execution of the program for the user.

提交回复
热议问题