Marshal.load Speed
Eric Hodel | Wed, 03 May 2006 04:52:41 GMT
File.open 'dump' do |fp| Marshal.load fp end
Is much slower than:
File.open 'dump' do |fp| Marshal.load fp.read end
Because the former uses IO#getc and the latter operates directly on a String.
I learned this tonight while helping profile code at a Seattle.rb hacking night.
2 commentsComments are disabled


Articles