In Adding opt_respond_to to the Ruby VM: part 1, inspired by recent JSON gem optimizations, I setup my goal: I want to add a new bytecode instruction to the Ruby VM which optimizes respond_to? calls. I took this Ruby code: if $stdout.respond_to?(:write) puts "Did you know you can write to $stdout?"end And identified what bytecode instructions matter most (I think): == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(3,3)> # ... 0002 putobject :write 0004 opt_send_without_block <calldata!mid:resp...