Issue #6972 has been updated by Glass_saga (Masaki Matsushita).

File patch2.diff added

????????????????????????????????????????????????????????令??????????opt_empty_p????????(idEmpty???BOP_EMPTY???????)?????????????追???????????????
----------------------------------------
Feature #6972: ??????令opt_empty??追???
https://bugs.ruby-lang.org/issues/6972#change-29190

Author: Glass_saga (Masaki Matsushita)
Status: Open
Priority: Normal
Assignee: ko1 (Koichi Sasada)
Category: YARV
Target version: 


YARV???????令opt_empty??追????????????????????
opt_empty???recv.empty???対?????????????令????opt_size???opt_length??????????String???Array???Hash????????????????????????????????

次???????????????opt_empty???????????????????????????????????????????????

require 'benchmark'

Ary = []
Times = 10_000_000

Benchmark.bm do |x|
  x.report do
    Times.times { Ary.empty? }
  end
end

trunk(r36890):
       user     system      total        real
   1.070000   0.000000   1.070000 (  1.086783)

proposed:
       user     system      total        real
   0.730000   0.000000   0.730000 (  0.745782)

?????????1.46?????????????????????????????????????????????

?1.46????????????????????????令?????????????????????????????????調????????opt_empty??似?????????令???????opt_size????????????????????
?????????trunk???r36890????compile.c???1874????(iseq_specialized_instruction()???opt_size???使??????????????)????????????????????
opt_size??????????????????????????????Ary.empty????Ary.size??置?????????????????????????????????????????????以????????????????????????

??????令opt_size????????????????:
      user     system      total        real
   1.060000   0.000000   1.060000 (  1.061210)

???????????????:
       user     system      total        real
   0.750000   0.000000   0.750000 (  0.765943)

????????????????????????????
opt_empty??????????令??????妥???????????????????????????????????

recv.empty????????????????中???????????????????????????????(?????empty?????????????? or empty??????????????????????)????????????????????????????????????????????????????????
?????????????????????????????対??????????????????????????????????????令?????????????価????????????????????????????????????????????????????


-- 
http://bugs.ruby-lang.org/