From: dmertz@... (denis) Date: 2004-07-16T00:12:18+09:00 Subject: Re: my ruby code won't go as fast as my perl code "Dave Burt" wrote in message news:... > > The main slow bit seems to be the string concatenation and comparison > (...+$4+$5+$6 >= start_date). > The addition operator always creates a new String object. So when you chain a lot of additions you have a lot of temporary String objects that are created. You can avoid that by using the Append ( << ) method (($3>='87'?'19':'20') << $3 << mm[$2] << $1 << $4 << $5 << $6 >= start_date) Alternatively you can use string interpolation ("#{($3>='87'?'19':'20')}#{$3}#{mm[$2]}#{$1}#{$4}#{$5}#{$6}" >= start_date) or Array.join, like that ([($3>='87'?'19':'20'), $3, mm[$2], $1, $4, $5, $6].join >= start_date) I hope it helps Denis