From: Joel VanderWerf Date: 2004-05-28T09:24:19+09:00 Subject: Re: Nasty string growth performance Tom Trebisky wrote: > buf = "" ... > buf += line and > buf = Array.new ... > buf.push line are not comparable constructs. The first one is the same as buf = buf + line which constructs a new string each time. The second one modifies the existing array in place, which is why you saw better performance. What you probably want is buf << line This just concatenates line on the end of the buf string, modifying buf in place. An advantage of this is that the same code works whether buf is a String or an Array (Array#<< is the same as Array#push).