Sunday, June 9, 2013

JIT compiling

Java is frikin fast now and in some cases it can be faster than C/C++. A large part of this is due to the Just in Time compiler (JIT). As it sounds, the Java JIT compiler does not compile all of the bye code at once. Instead it will analyze the code while it is running and figure out which chucks of code are frequently executed. Then it goes ahead and optimizes this code. Because it doesn't need to spend resources compiling code that is not run often, it can devote resources to compiling and optimizing the stuff that matters.