3 ms·
MRI has just added a JIT, I know nothing about it other than that it exists.
by steveklabnik 9y ago
MRI has just added a JIT, I know nothing about it other than that it exists.
- jashmatthews 9y agoMJIT works by taking MRI Ruby bytecode, replacing the instructions with the original C code, and compiling an entire method using GCC/LLVM. Because MRI Ruby is a threaded VM, it's easy to replace jumping to an instruction which dispatches to the next instruction, with jumping to some native code which dispatches to the next instruction. Right now, AFAIK, only very basic optimizations are enabled but just removing the overhead of VM dispatch between each instruction is a huge performance improvement.