From: Dmitry Nikiforov Date: 2012-02-03T11:45:38+09:00 Subject: Re: Basic Ruby performance Su Zhang wrote in post #1043831: > On 2/2/2012 9:14 PM, Dmitry Nikiforov wrote: >> > One thing you can do is to replace for loops with while loops. For loops > in Ruby will be translated to method calls to Enumerable#each, and in > Ruby 1.9, Enumerable#each is slower than using ordinary while loops > because of the overhead of processing enumerators. It is actually even > slower than Ruby 1.8's Enumerable#each because 1.8 does not have > enumerators. Hmmm... Thanks! Definitely useful advice! -- Posted via http://www.ruby-forum.com/.