From: SpringFlowers AutumnMoon Date: 2007-09-21T07:44:14+09:00 Subject: Re: why Ruby 1.8.2 is faster? Eric Hodel wrote: > > What program? How about something just like: on my Mac, the 1.8.2 runs about 46% faster than 1.8.6 ------ n = 1_000_000 start_time = Time.now for i in 1..n t = (1..10).inject {|x, y| x + y } end finish_time = Time.now p t puts print "Ruby ", RUBY_VERSION, " patch ", RUBY_PATCHLEVEL, " on ", RUBY_PLATFORM puts print "It took #{finish_time - start_time} seconds to run." print " #{(n / (finish_time - start_time)).to_i} iterations per second.\n" -- Posted via http://www.ruby-forum.com/.