On Dec 8, 2006, at 6:23 PM, Kem Tekinay wrote:

On 12/8/06 6:13 PM, Charles Yeomans at [EMAIL PROTECTED] wrote:

Okay.  Were you intending this to be a counterexample to my claim?

Well, I don’t think I would have phrased it that way, but I guess so. :-)

What your example shows is that Join is probably not faster than string concatenation for a small number of strings. I'm not too surprised by this. Compare these two methods and see which is faster.


dim s as String
for i as Integer = 1 to 10000
  s = s + "a"
next

dim buffer(-1) as String
for i as Integer = 1 to 10000
  buffer.Append "a"
next
dim s as String = Join(buffer, "")




Can you recommend a better way? It's all in the spirit of becoming better
coders, after all.


A better way for your original code? Probably not. While there may or may not be minor optimizations, I didn't see anything that would speed it up other than reading it all in and processing the resulting array, as you did. If this were something I needed to do, I might try reading in a BinaryStream and handling all of the parsing myself. But, as I said, this is what Perl is for.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to