Hi,

Just wondering if there is a trick to speed up the following:

% cat junk.rb
a = Hash.new
for i in 0..1000000
  a[i] = "joe"
end

for i in 0..1000000
  data = a[i]
end

/usr/bin/time ./junk.rb
34.55user 0.19system 0:34.73elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (232major+11360minor)pagefaults 0swaps


If I do a GC.disable it gets much better:

/usr/bin/time ./junk.rb
5.02user 0.13system 0:05.14elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (228major+12371minor)pagefaults 0swaps

I have tried the above with both 1.6.4 and 1.7.1 with generational
GC patch, results are about the same.

Should we just make sure that we turn off GC when doing something like
above?

python is about 4 seconds for the same thing and perl is 5.1 seconds.

thanks,
-joe