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

Technology CommunityCategory: AngularWhat does a just-in-time (JIT) compiler do (in general)?
VietMX Staff asked 3 years ago

A JIT compiler runs after the program has started and compiles the code (usually bytecode or some kind of VM instructions) on the fly (or just-in-time, as it’s called) into a form that’s usually faster, typically the host CPU’s native instruction set. A JIT has access to dynamic runtime information whereas a standard compiler doesn’t and can make better optimizations like inlining functions that are used frequently.

This is in contrast to a traditional compiler that compiles all the code to machine language before the program is first run.