From: SASADA Koichi Date: 2011-10-27T14:26:54+09:00 Subject: [ruby-core:40439] Re: JIT development for MRI Hi Carter, (2011/10/27 8:43), Carter Cheng wrote: > I guess when it comes to Ruby my sense is that the dynamism poses some > complex problems for development of a good JIT system. I know that Macruby > relies on the LLVM JIT system and this simplifies much of the coding.- > however the LLVM JIT system is rather heavyweight. There was some paper > describing for example the effect of substituting (not in much detail) tcg > in QEMU using the LLVM system and the performance was significantly impeded. In fact, YARV bytecode is not suitable (optimized) for JIT compilation. If I make a JIT compiler based on YARV, I'll make some tricks to overcome it. I have several ideas, however I don't have a spare time to try it. One hint is: as I said, YARV instructions are course-grain, because it is optimized for VM loop execution. > I am curious of what your sense is of this. I am somewhat speculating here- > but it would seem to me that one of the main limiting factors (not having > studied the exact sequence of instructions produced by MRI) is the extra > overhead in primitive operations due to the inability to infer which > operations to apply to a type statically and perhaps the overhead associated > with invoke/sends. Language dynamism is another one. But it should be beaten with profiling or some other techniques as Charlse posted [ruby-core:40437]. Cheers, Koichi -- // SASADA Koichi at atdot dot net