|
-
Nov 27th, 2004, 08:29 PM
#1
Thread Starter
Sleep mode
StringBuilder vs String ?
I'm using stringbuilder instead string (for critical performance issue) . Anyway , in this for loop ,
am I creating string objects(with the bolded font each time I call this line :
Code:
SplitedFilWriteStream = File.Create(Path.Combine(OutputPath ,FileNameOnly+segName[nSegmentCount-1].ToString() ));
The for loop looks like this :
PHP Code:
for (nSegmentCount =1; nSegmentCount <=nSegments_CompletetBuffered;nSegmentCount++)
{
segName.Append(nSegmentCount);
SplitedFilWriteStream = File.Create(Path.Combine(OutputPath ,FileNameOnly+segName[nSegmentCount-1].ToString()));
SegmentTotal += 1;
Last edited by Pirate; Nov 27th, 2004 at 08:42 PM.
-
Nov 28th, 2004, 02:05 PM
#2
Thread Starter
Sleep mode
bump or pumb if it helps....
-
Nov 28th, 2004, 08:39 PM
#3
Frenzied Member
Yes. Well, you're not creating the string object, but the .ToString() method would be. At least I think so Documentation doesn't actually specify that, but I guess that's the way it would have to be.
Would be interesting to decompile and see exactly what it's doing.
-
Nov 29th, 2004, 01:13 AM
#4
Thread Starter
Sleep mode
Originally posted by Mike Hildner
Yes. Well, you're not creating the string object, but the .ToString() method would be. At least I think so Documentation doesn't actually specify that, but I guess that's the way it would have to be.
Would be interesting to decompile and see exactly what it's doing.
Thanks , it sounds great idea . I agree with you for the ToString() function part which explains how strings are unchangable objs so they create new string objs everytime they get changed . This is what I understood from MSDN help .
I must try this and I'll tell you how it goes ...
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
|