From: Kevin Windham <[EMAIL PROTECTED]>
Date: Mon, 13 Feb 2006 08:09:32 -0600
On Feb 13, 2006, at 1:52 AM, Ronald Vogelaar wrote:
I am still puzzled. You responded to a posting about the speed of
reading chunks of text from a file and adding it to a string,
saying 'Join' would be much faster than FastString for that
purpose. I failed to understand where 'Join' would fit in, and
frankly, I still do.
It was posted earlier in the thread. Basically instead of
concatenating a string from the file to a buffer string each time you
read, you append a string to an array of strings. Then at the end of
your reading you "join" the array into one string. This prevents
creating a string every time you append instead of concatenate.
My FastString class will most definitely beat RB's join in this
situation.
Why? Because we know the final resulting string size, ahead of time.
We just do this:
MyFastString.Size = myFile.length
This eliminates slow buffer copies.
Also, have we even tested that it is faster than reading the file in
one go? I'm not sure that this chunk reading approach is worth it.
dim s as string
s = binarystream.read(binarystream.length)
If doing reads in chunks *is* faster, this only suggests that RS need
to speed up their binarystream! To be honest, I cant imagine why it
must be faster to do it via join or some kind of buffered approach
(eg my FastString). I'm not saying that it's not, just that
binarystream could easily be fixed by RS, if so.
--
http://elfdata.com/plugin/
_______________________________________________
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>