From: Robert Klemme Date: 2004-12-28T23:06:47+09:00 Subject: Re: help on making ruby code faster "David Garamond" schrieb im Newsbeitrag news:41D1623C.7090909@zara.6.isreserved.com... > Robert Klemme wrote: > > The general rule is that object creation is quite expensive. So it's > > always good to try to avoid it if possible. > > I applied your suggestions below and it got slightly worse. So I guess > object creation has been pretty optimized in Ruby? :-) .... or I introduced another slow operation that evens out the effect of the saved creations... > > You can save the downcase if you add values for lower and upper case > > characters to @@rd36 (if it's an array, maybe make it a hash). > > I do get slightly better performance by making @@rd36 an array instead > of a hash (originally it's a hash). Does freezing the array make a difference? Nah, probably not... robert