|
-
Feb 25th, 2003, 04:57 AM
#11
I'm very sorry to say that, amac, but that's just plain wrong. Simple as that.
A vector's memory strategy is different. It's implementation-specific, but no implementation grows just by one every time something is added.
MS's implementation grows by 50%, SGI's doubles its size.
And the .Net collections need to grow too.
The string reallocations don't count, the .Net framework reallocates too, and allocation on a managed heap takes longer than on the normal heap.
So it would make sense to specify an initial size, but it won't speed up the thing very much. Neither will a linked list do.
StringArray Results(20);
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|