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


optflags='-O0 -g'???篁??????????????????trunk???篏帥?c?????????с???????潟???????若???proposal???筝?綵????????с????????
optflags???紊??????????????????筝???с????潟???????若???????????眼???????????????篁ヤ????????????????障????????

trunk(r35087):
       user     system      total        real
   0.000000   0.000000   0.000000 (  0.000049)
proposal:
       user     system      total        real
   0.000000   0.000000   0.000000 (  0.000019)
----------------------------------------
Feature #6173: re.c???rb_memsearch()??????????memchr()?????
https://bugs.ruby-lang.org/issues/6173#change-24929

Author: Glass_saga (Masaki Matsushita)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0


re.c???rb_memsearch()??с???m == 1???翫??????for?????у???????ゃ??????莠??????????障????????memchr()?????????????ц?純??劫???????帥???????障?????
罨<????????????潟???????若???絎?茵?????????????????篁ヤ???????????????????????障????????

require 'benchmark'

str = "hoge" * 10000 + "\n"

Benchmark.bm do |x|
  x.report do
    str.index("\n")
  end
end

trunk(r35083):
       user     system      total        real 
   0.000000   0.000000   0.000000 (  0.000185)

proposal:
       user     system      total        real 
   0.000000   0.000000   0.000000 (  0.000018)

patch???羞私???????障?????


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