From: Dan Sugalski Date: 2003-08-26T00:31:32+09:00 Subject: Re: problem (?) with ruby handling 10^7 elements in one Array On Tue, 26 Aug 2003, gabriele renzi wrote: > I was doing some little tests with various 1.8 new idioms and in > specific with Array#new(size){block}. > > Anyway, it seems that ruby is *really* fast[1] with up to 10^6 > elements, while it dies with 10^7. > > The problem was this: create an array of N elements and stuff it with > random values. > > time goes up linearly with N, but with N=10000000 (ten millions) I get > a time that is 160 times greater than with N=1000000 (one milion). Sounds like you started swapping at that point, then finally ran out of memory. Did you monitor the process externally to see how the system was performing? Other than potentially wanting to make Ruby's internal structures smaller, there's not much to be done about this, as it's not really ruby's fault. Dan