Just-in-Time (JIT)
In computing, just-in-time compilation is compilation during execution of a program rather than before execution. This may consist of source code translation but is more commonly bytecode translation to machine code, which is then executed directly. (From Wikipedia)
I think I’ve seen this through TypeScript and Java.
What is JIT?
JIT compiler is part of JRE (Java Runtime Environment), it is used for better performance of the Java applications during run-time.
Use of JIT:
- Source code is compiled with javac compiler to form bytecode
- Bytecode is further passed to JVM
- JIT is a part of JVM, JIT is responsible for compiling bytecode into native machine code at run time.
- The JIT compiler is enabled throughout, while it gets activated when a method is invoked. For a compiled method, the JVM directly calls the compiled code, instead of interpreting it.
- As JVM calls the compiled code that increases the performance and speed of the execution.
More resource: JIT in java.