Thanks Koichi.

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.

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.

I may do some studies later but I am sure you have more experience in this
area than I do.

Regards,

Carter.



On Thu, Oct 27, 2011 at 5:28 AM, SASADA Koichi <ko1 / atdot.net> wrote:

> Thanks for reference.
>
> (2011/10/26 11:20), Carter Cheng wrote:
> > I noticed that you used context threading in YARV. Do you have some
> analysis
> > of this cost benefit wise over other methods? I was curious why you
> selected
> > this for ruby.
>
> We don't use context threading[1].  context threading needs a few
> assembler codes.  However, YARV doesn't use any assemblers.  In current
> our YARV bytecode, I doubt that we can't make it faster with it because
> of instruction granularity (course-grain instruction especially "send").
>
> [2] may also help you.
>
>
> [1] Context Threading: A Flexible and Efficient Dispatch Technique for
> Virtual Machine Interpreters
>
> http://dl.acm.org/citation.cfm?id=1048922.1048973&coll=DL&dl=GUIDE&CFID=63997736&CFTOKEN=37906754
>
> [2] Analyzing the performance of code-copying virtual machines
>
> http://dl.acm.org/citation.cfm?id=1449764.1449796&coll=DL&dl=GUIDE&CFID=63997736&CFTOKEN=37906754
>
> Regards,
> Koichi
>
> --
> // SASADA Koichi at atdot dot net
>
>