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


patch2.diff???????????潟????????????????????с???????????鐚?
???絲障???????????違?潟?????????????障?????
----------------------------------------
Feature #6440: 綣???違??IO???羝<???????翫?????Marshal.load????????????<?????????????????
https://bugs.ruby-lang.org/issues/6440#change-32957

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/