From: Dominik Werder Date: 2003-06-16T17:17:53+09:00 Subject: Re: Hispeed String concat I found also something interesting: "Pre#{i.to_s}Post" seams to me cheaper than 'Pre'< Often '<<' is fast, but not always. > > In one application, where I was generating a CVS file from a largish SQL > result set, I made the program over 100 times faster by changing > > result = "" > for r in results > csv_string = to_csv(r) > result << csv_string > end > > to > > result = [] > for r in results > csv_string = to_csv(r) > result << csv_string > end > result = result.join