Issue #6129 has been reported by Masaki Matsushita.

----------------------------------------
Feature #6129: String#each_line??????????memmem()?????
https://bugs.ruby-lang.org/issues/6129

Author: Masaki Matsushita
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 


memmem()???????GNU??≦宍????ゃ??????∽?違??????????障????????string.c???rb_str_each_line()??у?純?с???????違?????memmem()???????????篋???????罅??????障?????

罨<?????潟???????若???絎?茵??????障????????

require 'benchmark'

str = "hogehifuga" * 100_0000

Benchmark.bm do |x|
  x.report do
    str.each_line("hi") {}
  end
end

腟????:

trunk(r34969):

       user     system      total        real  
   0.790000   0.000000   0.790000 (  0.795141) 

       user     system      total        real  
   0.790000   0.000000   0.790000 (  0.795141) 

       user     system      total        real  
   0.790000   0.000000   0.790000 (  0.795141) 

proposal:

       user     system      total        real   
   0.510000   0.000000   0.510000 (  0.507389)  

       user     system      total        real  
   0.530000   0.000000   0.530000 (  0.541944) 

       user     system      total        real   
   0.520000   0.000000   0.520000 (  0.522825)  

篁ヤ?????????????memmem()???????????篋???с????????若????潟?鴻??劫?????荀?????????障?????
篏?????????壕?????絖????rb_default_rs????筝???с???????翫??????≪??memchr()??????????蕭????????膣≪??茵???????????????????c????????冴??
?????????若????潟?鴻????劫???????????????rb_default_rs篁ュ?????壕?????絖???????絎?????????翫?????帥?с?????

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


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