The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Marshal.load Speed

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Eric Hodel

Posts: 660
Nickname: drbrain
Registered: Mar, 2006

Eric Hodel is a long-time Rubyist and co-founder of Seattle.rb.
Marshal.load Speed Posted: May 2, 2006 10:55 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Eric Hodel.
Original Post: Marshal.load Speed
Feed Title: Segment7
Feed URL: http://blog.segment7.net/articles.rss
Feed Description: Posts about and around Ruby, MetaRuby, ruby2c, ZenTest and work at The Robot Co-op.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Eric Hodel
Latest Posts From Segment7

Advertisement
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.

Read: Marshal.load Speed

Topic: Adventures in technical book photography Previous Topic   Next Topic Topic: Historias de la Guerra de Bases de Datos

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use