Just-In-Time Compilation
Just-in-time compilation is the process of generating some or all of an applications binary executable machine code for an application at run-time. This technique is frequently used for improving the performance of interpreted programming languages, especially those implmented using virtual machines (VMs). Today, most Java and C# implementations make use of JIT compilation. When compared to traditional "Way-Ahead-Of-Time" compilation, as with C, C++ or fortran compilers, JIT compilation has both advantages and limitations.
The main disadvantage of this technique is the compilation/start-up cost at run-time. Because the generation of executable code happens while the application is running, this is an overhead not incurred in alternate implementations. Provided that the improvement in run-time is sufficiently large to outweigh this overhead, there will be a net gain in performance. However, this observable compile-time cost often forces JIT compilers to avoid the expensive analyses and optimizations sometimes performed by traditional compilers. To reduce some of this impact, most JIT-based compilers perform some level of pre-processing, such as generating byte codes, to simplify and speed-up the final performance-critical code generation step.
A significant advantage of JIT compilation is that the compilation system has a detailed knowledge of the target system; what type of architecture and processor it has (Intel vs AMD), how much memory it has, and even whether it has an attached NVidia or ATI GPGPU. Knowing details of the features and performance characteristics of the target permits much faster code than the generic portable code required for execution on a variety of systems, or tuned for a different architecture.
In the application areas of interest to NextMove Software, a major benefit of JIT-compilation is value-dependent optimization of domain specific code. At the point when machine code is generated many of the input parameters and variables of a program are known. This enables many compiler optimizations that take advantage of these constants, that are not available or possible with regular software engineering techniques.
Some example applications of JIT compilation are presented below.