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


??????????????????遺賢???????????????ャ?若?????????????????????????????????障?????

????Marshal??綵√??с???????泣?ゃ?冴????ャ????号???????????冴??????????????<????????????????????????????茯?翠???????障????障?????
ungetc??с?????????????seek?????純??IO??絲???????帥??????????<???????ゃ????????????????緇????IO#seek??ц昌茲??????????????????????????????с??????????????
蕭?????????с?????IO??腮蕁???????????????????障????障????????篋??????с?經??????????????????????障?????
----------------------------------------
Feature #6440: 綣???違??IO???羝<???????翫?????Marshal.load????????????<?????????????????
https://bugs.ruby-lang.org/issues/6440#change-26684

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


=begin
????(({Marshal.load}))??с???綣???違??(({IO}))???羝<?????(({IO#getbyte}))???(({IO#read}))??у??綺с???荀?????????帥?茯??水?冴?????膵違??菴????????
紊ч????<?純???????若?喝?冴???????榊??????????????潟?鴻???????∴????с????障????????
????????с??綣???違??(({IO}))???羝<???????翫?????(({Marshal.load}))????????????<??????????????篋???????罅??????障?????

  require 'benchmark'
  require 'tempfile'

  ary = Array.new(1000){ "hoge" }
  file = Tempfile.new("foo")
  Marshal.dump(ary, file)

  Benchmark.bm do |x|
    x.report do
      100.times do
        file.rewind
        Marshal.load(file)
      end
    end
  end

  file.close

筝?荐???????潟???????若??с??????????<???????ゃ????????????ruby???trunk???罸?莠?????????????????篁ヤ????????????????障????????

  trunk(r35660):
         user     system      total        real
     1.880000   0.000000   1.880000 (  1.874681)

  proposed:
         user     system      total        real
     0.180000   0.000000   0.180000 (  0.178556)

patch???羞私???????障?????
=end



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