Yukihiro Matsumoto
1/23/2005 9:55:00 AM
Hi,
In message "Re: looking at ruby..."
on Sun, 23 Jan 2005 18:43:10 +0900, Paris Sinclair <paris@perlpuma.net> writes:
|Since normally these are used for data structures not just strings, I would
|say, Storable is slow, and Marshal is twice as slow.
On your machine. I got
# time perl -MStorable='freeze,thaw' -e '$start = time; for($i=0;$i<100;$i++) { for($j=0;$j<100;$j++) { $foo[$i][$j] = ${thaw(freeze(\([rand,rand,rand])))} } }; print time - $start'
1
real 0m0.943s
user 0m0.900s
sys 0m0.005s
# time ruby -e 'foo = []; start = Time.new ; (0...100).each { |i| foo[i] = [] ; (0...100).each { |j| foo[i][j] = Marshal.load(Marshal.dump([rand,rand,rand])) } } ; puts Time.new - start'
0.371891
real 0m0.379s
user 0m0.334s
sys 0m0.004s
on my Linux box (Pentium M 1.6MHz).
matz.