<?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: LINQ in Depth: Understanding ToArray()</title>
	<atom:link href="http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linq-in-depth-understanding-toarray</link>
	<description></description>
	<lastBuildDate>Sun, 12 Feb 2012 18:54:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Christian</title>
		<link>http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/comment-page-1/#comment-34588</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Sun, 05 Oct 2008 12:18:54 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/#comment-34588</guid>
		<description>Well, the way i understand it, the use of buffer that needs to reallocate the size of the array is not unique to the second approach. The stringbuilder also works on an internal array, so to some extent the reallocation process will be a major part of what is taking time in both cases. However there are some factors that influence this and that maybe why your results are not completely conclusive. One major part is how much the array is expanded each time a reallocation occurs, and how many times this happens. Also string.join probably has some &quot;special treatment&quot; in the framework to help performance. Besides that the ToArray and String.Join probably both at the root require these kinds of operations, where your approach only requires reallocation of the array for the stringbuilder.

Anyway, its just my two cents, so now im broke..</description>
		<content:encoded><![CDATA[<p>Well, the way i understand it, the use of buffer that needs to reallocate the size of the array is not unique to the second approach. The stringbuilder also works on an internal array, so to some extent the reallocation process will be a major part of what is taking time in both cases. However there are some factors that influence this and that maybe why your results are not completely conclusive. One major part is how much the array is expanded each time a reallocation occurs, and how many times this happens. Also string.join probably has some &#8220;special treatment&#8221; in the framework to help performance. Besides that the ToArray and String.Join probably both at the root require these kinds of operations, where your approach only requires reallocation of the array for the stringbuilder.</p>
<p>Anyway, its just my two cents, so now im broke..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop - October 5, 2008 &#124; Alvin Ashcraft's Morning Dew</title>
		<link>http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/comment-page-1/#comment-34587</link>
		<dc:creator>Dew Drop - October 5, 2008 &#124; Alvin Ashcraft's Morning Dew</dc:creator>
		<pubDate>Sun, 05 Oct 2008 12:13:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/#comment-34587</guid>
		<description>[...] LINQ in Depth: Understanding ToArray() (Chris Brandsma) [...]</description>
		<content:encoded><![CDATA[<p>[...] LINQ in Depth: Understanding ToArray() (Chris Brandsma) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/comment-page-1/#comment-34561</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Sun, 05 Oct 2008 07:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2008/10/04/linq-in-depth-understanding-toarray/#comment-34561</guid>
		<description>Thanks for trying this :D

sb.Remove(sb.Length - delimiter.Length, 1); should still be
sb.Remove(sb.Length - delimiter.Length, delimiter.Length);

Otherwise you only remove the first character of your delimiter.

For most uses it doesn&#039;t matter then but I&#039;ll keep it in mind when I have to use a lot of strings :)</description>
		<content:encoded><![CDATA[<p>Thanks for trying this <img src='http://elegantcode.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>sb.Remove(sb.Length &#8211; delimiter.Length, 1); should still be<br />
sb.Remove(sb.Length &#8211; delimiter.Length, delimiter.Length);</p>
<p>Otherwise you only remove the first character of your delimiter.</p>
<p>For most uses it doesn&#8217;t matter then but I&#8217;ll keep it in mind when I have to use a lot of strings <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

