From: botp Date: 2012-02-03T13:03:29+09:00 Subject: Re: Basic Ruby performance On Fri, Feb 3, 2012 at 11:52 AM, botp wrote: > On Fri, Feb 3, 2012 at 6:20 AM, Dmitry Nikiforov wrote: >> x=Time.now();for a in 0..1E3;end; puts(Time.now-x) > 0.000380635 >> x=Time.now();for a in 0..1E4;end; puts(Time.now-x) > 0.00373148 >> x=Time.now();for a in 0..1E5;end; puts(Time.now-x) > 0.029043426 >> x=Time.now();for a in 0..1E6;end; puts(Time.now-x) > 0.201745265 >> x=Time.now();for a in 0..1E7;end; puts(Time.now-x) > 1.939860867 >> x=Time.now();for a in 0..1E8;end; puts(Time.now-x) > 19.276653266 > note, the jump... using plain fixnum may help, but the jump is still there > (3..8).each do |x| > t=Time.now();for a in 0..10**x;end; puts("#{x} #{Time.now()-t}") > end 3 0.000142406 4 0.001344933 5 0.014539207 6 0.076141941 7 0.737979205 8 7.359555691 best regards -botp