Re:From Rails to Clojure, Then to Java, Then Back to Rails
by steveklabnik on Wednesday March 21, 2018 @02:21PM
(#16640941)
MRI has just added a JIT, I know nothing about it other than that it exists.
[ Parent
| on HN ]
Re:From Rails to Clojure, Then to Java, Then Back to Rails
by jashmatthews on Wednesday March 21, 2018 @05:21PM
(#16642542)
MJIT 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.