Great second post, it's impressive how quick you go deep in details without losing the reader, at least I love this style, no fluff, straight to what's interesting and then back to the problem at hand.
Looking forward to the next ones!
And of course, TruffleRuby already inline caches respond_to?, same for all other metaprogramming methods :)
Splitting helps to keep these nested inline caches monomorphic automatically
Comments
json 2.7.2 500,000 jobs in 24.342253 sec, 20540 jobs/sec
json 2.9.1 500,000 jobs in 23.762558 sec, 21041 jobs/sec
And Sidekiq's json API usage: https://github.com/sidekiq/sidekiq/blob/8648e796ff372acfce8afc2c32fa7d3ba77a449c/lib/sidekiq.rb#L53-L59
Looking forward to the next ones!
Splitting helps to keep these nested inline caches monomorphic automatically
Since there's a single level of cache the difference may not be that huge, I'm not sure.