From: Charlie Somerville Date: 2013-05-20T19:04:10+09:00 Subject: [ruby-core:55087] Re: [ruby-trunk - Feature #8426][Open] Implement class hierarchy method caching --5199f36d_649bb77c_168 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday, 20 May 2013 at 7:39 PM, SASADA Koichi wrote: > Is it huge performance bottleneck? I think branch on inline cache should be removed > > This helps a lot when Ruby programs are starting up because the full class hierarchy does not need to be traversed as often. I'll rewrite the guard to be branch free and see if there is any performance improvement. > I prefer `st_' related name. But not strong opinion. I disagree because they are unrelated data structures. > One more: > > if (LIKELY(GET_METHOD_STATE_VERSION() == ci->vmstat && > RCLASS_EXT(klass)->seq == ci->seq && > klass == ci->klass)) { > > should be: > > if (LIKELY(GET_METHOD_STATE_VERSION() == ci->vmstat && > klass == ci->klass && > RCLASS_EXT(klass)->seq == ci->seq) { > > I don't think the order of checks matters, except for maybe performance reasons. I'll experiment with making this branch free instead. --5199f36d_649bb77c_168 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On M= onday, 20 May 2013 at 7:39 PM, SASADA Koichi wrote:
Is it huge performance b= ottleneck=3F I think branch on inline cache should be removed
=
This helps a lot when Ruby programs are st= arting up because the full class hierarchy does not need to be traversed = as often.

I'll rewrite the guard to be branch fr= ee and see if there is any performance improvement.

<= blockquote type=3D=22cite=22 style=3D=22border-left-style:solid;border-wi= dth:1px;margin-left:0px;padding-left:10px;=22>I prefer =60st=5F' related = name. But not strong opinion.
I disagree because they ar= e unrelated data structures.
 
One more:

= if (LIKELY(GET=5FMETHOD=5FSTATE=5FVERSION() =3D=3D ci->vmstat &&a= mp;
RCLASS=5FEXT(klass)->seq =3D=3D ci->seq &= &
klass =3D=3D ci->klass)) =7B

should be:

if (LIKELY(GET=5FMETHOD=5F= STATE=5FVERSION() =3D=3D ci->vmstat &&
klass= =3D=3D ci->klass &&
RCLASS=5FEXT(klass)->= ;seq =3D=3D ci->seq) =7B
I d= on't think the order of checks matters, except for maybe performance reas= ons. I'll experiment with making this branch free instead.
--5199f36d_649bb77c_168--