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


????????????????????????????????????????????????????????????????????

require 'benchmark'

str = "hoge" * 100_0000 + "fugafuga"

Benchmark.bm do |x|
  x.report do
    1000.times { str.index("fugafuga") }
  end
end

trunk(r37617):
       user     system      total        real
   7.540000   0.000000   7.540000 (  7.539292)

proposed:
       user     system      total        real
   0.500000   0.000000   0.500000 (  0.503217)

????????????添???????????patch????configure.in???AC_CHECK_FUNCS(memmem)??????????
AC_TRY_RUN???glibc 2.0以?????memmem()????????????????????????????確?????BROKEN_MEMMEM????義???????????????????
1?????????2????????????義???????????????????????????????????memmem()??????????????????????????????????????HAVE_MEMMEM??????義??????????????????????????

???対??????????????????????????????????????????????
----------------------------------------
Feature #6311: memmem()???????rb_memsearch()??????????
https://bugs.ruby-lang.org/issues/6311#change-32763

Author: Glass_saga (Masaki Matsushita)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: core
Target version: 


[Feature #6129][ruby-dev:45344]????似????????????????memmem()???????re.c???rb_memsearch()?????????????試??????????

次??????????????????????????????以?????????????????????????????????????????????????

require 'benchmark'

str = "hoge" * 10000 + "fugafuga"

Benchmark.bm do |x|
  x.report do
    1000.times { str.index("fugafuga") }
  end
end

trunk(r35363):
       user     system      total        real
   0.070000   0.000000   0.070000 (  0.072126)
       user     system      total        real
   0.070000   0.010000   0.080000 (  0.081420)
       user     system      total        real
   0.080000   0.000000   0.080000 (  0.091658)

proposal:
       user     system      total        real
   0.000000   0.000000   0.000000 (  0.004237)
       user     system      total        real
   0.000000   0.000000   0.000000 (  0.003737)
       user     system      total        real
   0.010000   0.000000   0.010000 (  0.004696)

patch???添????????????


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