|
RE: Clean way to do string.join: msg#00204org.user-groups.dotnet.padnug
Hmmm, yes, interesting point. But I'm not positive which would be optimal. Granted the format string needs to be parsed, but there is a specific overload for StringBuilder.AppendFormat( string format, object arg0, object arg1 ) which might be optimized. OTOH, calling Append twice is more overhead in making two calls. Or does the actual appending of strings in StringBuilder dominate the performance? It's going to be hard to tell without profiling and measuring actual performance, assuming it became important. And I am not sure that I'd expect the same results for the .NET Framework and the Compact Framework - they could be implemented entirely differently. Sounds like a great interview question! Cheers, Stuart Stuart Celarier | Fern Creek | www.ferncrk.com -----Original Message----- From: John Theisen [mailto:jtheisenpdx@xxxxxxxxx] Sent: Wednesday, January 26, 2005 11:08 AM To: padnug@xxxxxxxxxxxxxxx Subject: RE: [padnug] Clean way to do string.join Stuart, I think that the line sb.AppendFormat ( "{0}{1}", separator, value[i] ) should be rewritten as sb.Append(separator).Append(value[i]); in the spirit of optimization. -- John Theisen jtheisenpdx@xxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Clean way to do string.join: 00204, Matthew Klump |
|---|---|
| Next by Date: | Re: Clean way to do string.join: 00204, Craig Wagner |
| Previous by Thread: | RE: Clean way to do string.joini: 00204, Matthew Klump |
| Next by Thread: | Re: Clean way to do string.join: 00204, Craig Wagner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |