<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Clear C# StringBuilder</title>
	<atom:link href="http://www.csharp411.com/clear-c-stringbuilder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/clear-c-stringbuilder/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Sat, 24 Jul 2010 01:26:51 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Unmesh Kondolikar</title>
		<link>http://www.csharp411.com/clear-c-stringbuilder/comment-page-1/#comment-5487</link>
		<dc:creator>Unmesh Kondolikar</dc:creator>
		<pubDate>Fri, 14 May 2010 12:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/clear-c-stringbuilder/#comment-5487</guid>
		<description>If you want a Clear method for more intuitive syntax you can write an extension method on the StringBuilder class and set the length to 0 in that method.</description>
		<content:encoded><![CDATA[<p>If you want a Clear method for more intuitive syntax you can write an extension method on the StringBuilder class and set the length to 0 in that method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.csharp411.com/clear-c-stringbuilder/comment-page-1/#comment-5368</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 26 Jan 2010 00:23:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/clear-c-stringbuilder/#comment-5368</guid>
		<description>According to these guys:
http://stackoverflow.com/questions/266923/is-using-stringbuilder-remove-method-more-memory-efficient-than-creating-a-new-st

Option 2 is faster if you initialize the capacity of the new StringBuilder (to 32 in their case).</description>
		<content:encoded><![CDATA[<p>According to these guys:<br />
<a href="http://stackoverflow.com/questions/266923/is-using-stringbuilder-remove-method-more-memory-efficient-than-creating-a-new-st" rel="nofollow">http://stackoverflow.com/questions/266923/is-using-stringbuilder-remove-method-more-memory-efficient-than-creating-a-new-st</a></p>
<p>Option 2 is faster if you initialize the capacity of the new StringBuilder (to 32 in their case).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/clear-c-stringbuilder/comment-page-1/#comment-4221</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Thu, 05 Mar 2009 01:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/clear-c-stringbuilder/#comment-4221</guid>
		<description>1. How would option 1 affect GC performance for 1M small object collection/compaction?

I assume it would slow down the GC, but perhaps not enough to worry.


2. If we break through the ~85K large object size, would option 1 start fragmenting memory?

By creating &gt;85K strings?  Then creating a new 85K StringBuilder object every time would definitely impact performance negatively.</description>
		<content:encoded><![CDATA[<p>1. How would option 1 affect GC performance for 1M small object collection/compaction?</p>
<p>I assume it would slow down the GC, but perhaps not enough to worry.</p>
<p>2. If we break through the ~85K large object size, would option 1 start fragmenting memory?</p>
<p>By creating >85K strings?  Then creating a new 85K StringBuilder object every time would definitely impact performance negatively.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.csharp411.com/clear-c-stringbuilder/comment-page-1/#comment-4220</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 05 Mar 2009 00:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/clear-c-stringbuilder/#comment-4220</guid>
		<description>1. How would option 1 affect GC performance for 1M small object collection/compaction?

2. If we break through the ~85K large object size, would option 1 start fragmenting memory?</description>
		<content:encoded><![CDATA[<p>1. How would option 1 affect GC performance for 1M small object collection/compaction?</p>
<p>2. If we break through the ~85K large object size, would option 1 start fragmenting memory?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://www.csharp411.com/clear-c-stringbuilder/comment-page-1/#comment-4181</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Mon, 09 Feb 2009 10:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.csharp411.com/clear-c-stringbuilder/#comment-4181</guid>
		<description>The difference is even smaller with faster PC&#039;s. My results for 1M (your code):
new = 00:00:02.3437500, append = 00:00:01.9843750

So, while Option 2 is faster, nobody is really going to notice it anyway.</description>
		<content:encoded><![CDATA[<p>The difference is even smaller with faster PC's. My results for 1M (your code):<br />
new = 00:00:02.3437500, append = 00:00:01.9843750</p>
<p>So, while Option 2 is faster, nobody is really going to notice it anyway.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
