From: Joel VanderWerf Date: 2008-04-11T05:44:07+09:00 Subject: Re: performance tips Vince Forgetta wrote: > Hi all, > > I've been using ruby for about 2 years, but only recently got around trying > and learning it well. > > Is there some central repository I can get performance tips/discussions such > as the one posted here: > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/158212 Instead of: lines = File.readlines('sometextfile').each {|l| l.chomp!} do this: lines = File.open "test" do |f| f.map {|line| line.chomp} end That saves you from having the large string returned by #readlines. Sorry, no idea if these tips are collected somewhere. The rubygarden wiki used to have them, IIRC, but it got killed by spam. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407