From: Carter Cheng Date: 2011-10-27T08:43:36+09:00 Subject: [ruby-core:40423] Re: JIT development for MRI --bcaec54ee4445a5f6b04b03c39a9 Content-Type: text/plain; charset=ISO-8859-1 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 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 > > --bcaec54ee4445a5f6b04b03c39a9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks Koichi.

I guess when it comes to Ruby my sense is= that the dynamism poses some complex problems for development of a good JI= T system. I know that Macruby relies on the LLVM JIT system and this simpli= fies much of the coding.- however the LLVM JIT system is rather heavyweight= . There was some paper describing for example the effect of substituting (n= ot in much detail) tcg in QEMU using the LLVM system and the performance wa= s significantly impeded.

I am curious of what your sense is of this. I am somewh= at 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 overhe= ad 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=E3=80=80for reference.

(2011/10/26 11:20), Carter Cheng wrote:
> I noticed that you used context threading in YARV. Do you have some an= alysis
> of this cost benefit wise over other methods? I was curious why you se= lected
> this for ruby.

We don't use context threading[1]. =C2=A0context threading needs = a few
assembler codes. =C2=A0However, YARV doesn't use any assemblers. =C2=A0= 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&= quot;).

[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=3D1048922.1048973&coll=3DDL&d= l=3DGUIDE&CFID=3D63997736&CFTOKEN=3D37906754

[2] Analyzing the performance of code-copying virtual machines
http://dl.acm.org/citation.cfm?id=3D1449764.1449796&coll=3DDL&d= l=3DGUIDE&CFID=3D63997736&CFTOKEN=3D37906754

Regards,
Koichi

--
// SASADA Koichi at atdot dot net


--bcaec54ee4445a5f6b04b03c39a9--