3 ms·
Ruby 2.6 introduces an initial implementation of JIT compiler
- yoklov 8y ago> Ruby’s JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code Well, uh, that is one way to do it...
- lifthrasiir 8y agoThere are some convincing rationales [1]. In short, they chose to trade-off warm-up time and (probably) base line performance for implementation complexity and peak performance after warming up. I'm pretty much amazed that this idea does seem to work somehow. [1] https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#a-few-possible-approaches-in-jit-implementation https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch#a-few...
- ksec 8y agois Vladimir still working on Ruby?
- rurban 8y agoFor sure it works, because it's the most primitive hack one can think of. But it doesn't scale when the filesystem locking gets in your way, esp. on slow systems. In Perl we did something similar with an embedded tcc, but then eventually switched to emit machine-code directly to memory, or using llvm with linked bitcode, as later done in postgresql. Shame that his stack branch also got turned down, because this was more important.
- pmontra 8y ago> The main purpose of this JIT release is to provide a chance to check if it works for your platform and to find out security risks before the 2.6 release. Generating the C source code probably helps finding bugs.