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


?????潟???????若??????激??絨???????????絽吾????????????х??????c?????障?????篁??????????綏???????????????醇?с????????с????????????c?????с??
???絖??????紊????????膵???菴?????????違??紜?????????????潟???????若???????????眼????障????????

require 'benchmark'

str = " " * 10_0000 + "\n"

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

trunk(r37428):
       user     system      total        real
   0.940000   0.000000   0.940000 (  0.933771)

proposal:
       user     system      total        real
   0.090000   0.000000   0.090000 (  0.093609)

????????????????若????潟?鴻???筝??????帥???????????с?????絲障???????????医?????莨若????с?潟??????????????????????????障?????
----------------------------------------
Feature #6173: re.c???rb_memsearch()??????????memchr()?????
https://bugs.ruby-lang.org/issues/6173#change-32242

Author: Glass_saga (Masaki Matsushita)
Status: Assigned
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
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/