<?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: String Concatenation optimization</title>
	<atom:link href="http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/</link>
	<description>My Views on ColdFusion, Java and related technologies</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:41:45 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ColdFusion Array : pass by reference or Value. &#171; ColdFused?</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/comment-page-1/#comment-385</link>
		<dc:creator>ColdFusion Array : pass by reference or Value. &#171; ColdFused?</dc:creator>
		<pubDate>Wed, 15 Jul 2009 12:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/30/string-concatenation-optimization/#comment-385</guid>
		<description>[...] rightly pointed out in my  last post  that since ColdFusion array are always passed by value, the second technique can not be used if you [...]</description>
		<content:encoded><![CDATA[<p>[...] rightly pointed out in my  last post  that since ColdFusion array are always passed by value, the second technique can not be used if you [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/comment-page-1/#comment-135</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Thu, 05 Jul 2007 16:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/30/string-concatenation-optimization/#comment-135</guid>
		<description>@Crish, you are right. &lt;br/&gt;There is a small mistake there. Since  there are many append methods in StringBuffer class, CF did not know which one to invoke. Replace the line&lt;br/&gt;&lt;br/&gt;&lt;cfset sb.append(i)&gt;&lt;br/&gt;&lt;br/&gt;with&lt;br/&gt;&lt;cfset sb.append(javacast(&quot;String&quot;, i))&gt;&lt;br/&gt;&lt;br/&gt;and it will work fine.</description>
		<content:encoded><![CDATA[<p>@Crish, you are right. <br />There is a small mistake there. Since  there are many append methods in StringBuffer class, CF did not know which one to invoke. Replace the line</p>
<p>&lt;cfset sb.append(i)&gt;</p>
<p>with<br />&lt;cfset sb.append(javacast(&#8221;String&#8221;, i))&gt;</p>
<p>and it will work fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crish</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/comment-page-1/#comment-134</link>
		<dc:creator>crish</dc:creator>
		<pubDate>Mon, 02 Jul 2007 09:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/30/string-concatenation-optimization/#comment-134</guid>
		<description>Hey Rupesh,&lt;br/&gt;&lt;br/&gt;this code is not working?&lt;br/&gt;&lt;br/&gt;createObject(&quot;java&quot;,&quot;java.lang.StringBuffer&quot;)&gt;&lt;br/&gt;cfloop from=1 to=100 index=i&gt;&lt;br/&gt;  cfset sb.append(&quot;something&quot;)&lt;br/&gt;  cfset sb.append(i)&lt;br/&gt;/cfloop&gt;&lt;br/&gt;cfset result=sb.toString()</description>
		<content:encoded><![CDATA[<p>Hey Rupesh,</p>
<p>this code is not working?</p>
<p>createObject(&#8221;java&#8221;,&#8221;java.lang.StringBuffer&#8221;)><br />cfloop from=1 to=100 index=i><br />  cfset sb.append(&#8221;something&#8221;)<br />  cfset sb.append(i)<br />/cfloop><br />cfset result=sb.toString()</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rupesh Kumar</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/comment-page-1/#comment-133</link>
		<dc:creator>Rupesh Kumar</dc:creator>
		<pubDate>Tue, 06 Feb 2007 14:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/30/string-concatenation-optimization/#comment-133</guid>
		<description>Nice point Ben ! If you want to build it over some method calls, you should not use ColdFusion array. StringBuffer is your best friend in that case :)</description>
		<content:encoded><![CDATA[<p>Nice point Ben ! If you want to build it over some method calls, you should not use ColdFusion array. StringBuffer is your best friend in that case <img src='http://www.rupeshk.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Nadel</title>
		<link>http://www.rupeshk.org/blog/index.php/2007/01/string-concatenation-optimization/comment-page-1/#comment-132</link>
		<dc:creator>Ben Nadel</dc:creator>
		<pubDate>Tue, 06 Feb 2007 13:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://rupesh106.wordpress.com/2007/01/30/string-concatenation-optimization/#comment-132</guid>
		<description>One thing that I wanted to point out (that might not be thought of by all) is that Arrays are passed by value where as Java objects are passed by reference. What does this mean for string concatenation? Not much, unless you have some sort of recursive function or something that builds a string over a bunch of method calls. Using a Java String Buffer, you can keep passing the buffer object to the methods as an object to write to without worrying about the overhead of object copying.&lt;br /&gt;&lt;br /&gt;If you try to do the same with a ColdFusion array, it&#039;s structure will get duplicated with every method call (passed by value) which will have some performance implications. &lt;br /&gt;&lt;br /&gt;So, again, good tip, but here&#039;s just another angle to contemplate that might not be obvious.</description>
		<content:encoded><![CDATA[<p>One thing that I wanted to point out (that might not be thought of by all) is that Arrays are passed by value where as Java objects are passed by reference. What does this mean for string concatenation? Not much, unless you have some sort of recursive function or something that builds a string over a bunch of method calls. Using a Java String Buffer, you can keep passing the buffer object to the methods as an object to write to without worrying about the overhead of object copying.</p>
<p>If you try to do the same with a ColdFusion array, it&#8217;s structure will get duplicated with every method call (passed by value) which will have some performance implications. </p>
<p>So, again, good tip, but here&#8217;s just another angle to contemplate that might not be obvious.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

