You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
YJIT: implement fast path for kernel#is_a? using type info from context #474
Jimmy suggests that this is a large percentage of time spent on liquid-render.
Many calls to foo.is_a? Integer. We could optimize this if we already have type information from the context, which would result in less code generated and possibly a noticeable performance boost.
Currently, we generate a large chunk of code to call into a C function every time:
Activity
k0kubun commentedon Dec 21, 2022
Yeah
Kernel#is_a?seems to be called a lot ruby/ruby-bench#123. Optimizing it would be nice.maximecb commentedon Dec 21, 2022
Liquid also seems to use
Kernel#kind_of?. Is that an alias tois_a?k0kubun commentedon Dec 21, 2022
Technically speaking, not implemented as an alias method, but it does use the same implementation https://github.com/ruby/ruby/blob/398aaed2f0e56a81c5c15cc1126b6bbba79ffec0/object.c#L4406-L4407.
maximecb commentedon Dec 21, 2022
So then, double the optimization opportunity @jimmyhmiller :)
XrXr commentedon Feb 15, 2023
Done in ruby#7297