3 ms·
The title is misleading, just like other commenters mentioned. Just check how much indirection "rb_iv_get()" has to make (at the end, it will call [1], which is
by dig1 3y ago
The title is misleading, just like other commenters mentioned. Just check how much indirection "rb_iv_get()" has to make (at the end, it will call [1], which isn't "a light" call). Now, check generated JIT code (in a blog post) for the same action where JIT knows how to shave off unnecessary indirection.
We are comparing apples and oranges here.
[1] https://github.com/ruby/ruby/blob/b635a66e957e4dd3fed83ef1d72ce8c9b57e0430/variable.c#L1218 https://github.com/ruby/ruby/blob/b635a66e957e4dd3fed83ef1d7...
- vidarh 3y agoYes, it may well be misleading, yet you're making the point of the commenter you replied to while pointing out why the article is interesting. If you're a position where you're using Ruby and considering whether writing a C extension will speed things up, it has valuable advice on what other things to also try. That is a lot more interesting to me than the title.
- xxs 3y agoThe article findings apply to any managed language. Don't call extern libs often as the call overhead is non-trivial and it cannot be inlined. There's nothing new about
- vidarh 3y agoThat one part is nothing new. That does not mean the specific mechanisms of what to do to take advantage of this for Ruby isn't of interest to Ruby developers, who are the main audience for this given it's posted on the blog for Shopify's Ruby/Rails team.