<?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: Did escape analysis escape from Java 6?</title>
	<atom:link href="http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/</link>
	<description></description>
	<lastBuildDate>Thu, 11 Mar 2010 16:23:01 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: am</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-93822</link>
		<dc:creator>am</dc:creator>
		<pubDate>Fri, 15 Jan 2010 18:19:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-93822</guid>
		<description>Another advantage of Escape Analysis is that objects are allocated onto the stack. So you can get reduce the load on the GC. That can be a significant optimization.</description>
		<content:encoded><![CDATA[<p>Another advantage of Escape Analysis is that objects are allocated onto the stack. So you can get reduce the load on the GC. That can be a significant optimization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heinz Kabutz</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-93635</link>
		<dc:creator>Heinz Kabutz</dc:creator>
		<pubDate>Wed, 23 Dec 2009 20:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-93635</guid>
		<description>Hi Jeroen,

your articles on this topic are really good, especially the one on InfoQ.  I wanted to write an article on Escape Analysis and you&#039;ve done such a nice job that I&#039;ll leave my readers to catch up on a great definition from your article.

However, I&#039;ve discovered something rather interesting to do with Escape Analysis that I think I&#039;ll publish before the end of 2009 :-)

Regards from Crete, come visit us here some time :-)

Heinz</description>
		<content:encoded><![CDATA[<p>Hi Jeroen,</p>
<p>your articles on this topic are really good, especially the one on InfoQ.  I wanted to write an article on Escape Analysis and you&#8217;ve done such a nice job that I&#8217;ll leave my readers to catch up on a great definition from your article.</p>
<p>However, I&#8217;ve discovered something rather interesting to do with Escape Analysis that I think I&#8217;ll publish before the end of 2009 <img src='http://blog.xebia.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Regards from Crete, come visit us here some time <img src='http://blog.xebia.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Heinz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen Borgers</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-93615</link>
		<dc:creator>Jeroen Borgers</dc:creator>
		<pubDate>Tue, 22 Dec 2009 09:03:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-93615</guid>
		<description>Hi Heinz,

You made a good point about premature optimizations. It triggered me to investigate and write this blog, because your StringBuilder vs. StringBuffer measurements mismatched with my assumption that Escape Analysis was working. It evolved in my further articles on InfoQ (with help of Kirk): 
http://www.infoq.com/articles/java-threading-optimizations-p1

Jeroen.</description>
		<content:encoded><![CDATA[<p>Hi Heinz,</p>
<p>You made a good point about premature optimizations. It triggered me to investigate and write this blog, because your StringBuilder vs. StringBuffer measurements mismatched with my assumption that Escape Analysis was working. It evolved in my further articles on InfoQ (with help of Kirk):<br />
<a href="http://www.infoq.com/articles/java-threading-optimizations-p1" rel="nofollow">http://www.infoq.com/articles/java-threading-optimizations-p1</a></p>
<p>Jeroen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heinz Kabutz</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-93609</link>
		<dc:creator>Heinz Kabutz</dc:creator>
		<pubDate>Mon, 21 Dec 2009 20:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-93609</guid>
		<description>Hi Jeroen,

only saw your reference to my interview now.  My point was not to show that StringBuilder was faster than StringBuilder, but rather that premature optimizations lets us do unnecessary work that may result in slower code.

You could have just as well written your method

public static String concatBuilder(String s1, String s2, String s3) {
	return s1 + s2 + s3;
}

which could take advantage of future improvements of the String concatenation.

In your example, your Strings are very short, so there is no expansion of the underlying array.  Under other circumstances it would be faster to first size the array and then create the StringBuilder.  You could even reuse the StringBuilder, which again, can improve the performance.  These changes could be added into your code by the javac compiler, as long as you stuck the simple and clean s1 + s2 + s3.

Hope that clarifies my point a bit better now?  Don&#039;t optimize prematurely!

Heinz</description>
		<content:encoded><![CDATA[<p>Hi Jeroen,</p>
<p>only saw your reference to my interview now.  My point was not to show that StringBuilder was faster than StringBuilder, but rather that premature optimizations lets us do unnecessary work that may result in slower code.</p>
<p>You could have just as well written your method</p>
<p>public static String concatBuilder(String s1, String s2, String s3) {<br />
	return s1 + s2 + s3;<br />
}</p>
<p>which could take advantage of future improvements of the String concatenation.</p>
<p>In your example, your Strings are very short, so there is no expansion of the underlying array.  Under other circumstances it would be faster to first size the array and then create the StringBuilder.  You could even reuse the StringBuilder, which again, can improve the performance.  These changes could be added into your code by the javac compiler, as long as you stuck the simple and clean s1 + s2 + s3.</p>
<p>Hope that clarifies my point a bit better now?  Don&#8217;t optimize prematurely!</p>
<p>Heinz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dema</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-93291</link>
		<dc:creator>Dema</dc:creator>
		<pubDate>Tue, 01 Dec 2009 05:03:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-93291</guid>
		<description>java -Xbatch -server -XX:+DoEscapeAnalysis -XX:+EliminateLocks -XX:+UseBiasedLocking -XX:+AggressiveOpts LockTest

StringBuffer: 2764 ms.
StringBuilder: 2395 ms.
Thread safety overhead of StringBuffer: 15%

java -version
java version &quot;1.6.0_14&quot;
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)</description>
		<content:encoded><![CDATA[<p>java -Xbatch -server -XX:+DoEscapeAnalysis -XX:+EliminateLocks -XX:+UseBiasedLocking -XX:+AggressiveOpts LockTest</p>
<p>StringBuffer: 2764 ms.<br />
StringBuilder: 2395 ms.<br />
Thread safety overhead of StringBuffer: 15%</p>
<p>java -version<br />
java version &#8220;1.6.0_14&#8243;<br />
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)<br />
Java HotSpot(TM) Server VM (build 14.0-b16, mixed mode)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ismael Juma</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-66692</link>
		<dc:creator>Ismael Juma</dc:creator>
		<pubDate>Fri, 05 Dec 2008 23:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-66692</guid>
		<description>Hi,

It&#039;s actually a mistake to use -XX:CompileThreshold=1 as it will cause worse code to be generated. The reason for this is that the JIT has not collected enough profiling information. In general, it&#039;s best not to change that setting and to simply allow enough time for the JVM to warm up.

Ismael</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It&#8217;s actually a mistake to use -XX:CompileThreshold=1 as it will cause worse code to be generated. The reason for this is that the JIT has not collected enough profiling information. In general, it&#8217;s best not to change that setting and to simply allow enough time for the JVM to warm up.</p>
<p>Ismael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stanimir</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-65574</link>
		<dc:creator>stanimir</dc:creator>
		<pubDate>Sun, 30 Nov 2008 16:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-65574</guid>
		<description>When performing micro benchmarks, it&#039;s a nice touch to use -XX:CompileThreshold=1
so HotSpot compiles everything from scratch</description>
		<content:encoded><![CDATA[<p>When performing micro benchmarks, it&#8217;s a nice touch to use -XX:CompileThreshold=1<br />
so HotSpot compiles everything from scratch</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roel Spilker</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-54586</link>
		<dc:creator>Roel Spilker</dc:creator>
		<pubDate>Fri, 26 Sep 2008 15:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-54586</guid>
		<description>Thank you for your quick reponse. I likes the article.</description>
		<content:encoded><![CDATA[<p>Thank you for your quick reponse. I likes the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen Borgers</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-54580</link>
		<dc:creator>Jeroen Borgers</dc:creator>
		<pubDate>Fri, 26 Sep 2008 14:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-54580</guid>
		<description>Thanks Roel.
This blog has actually evolved into a series of two articles on InfoQ. Warming up is indeed way too short here, this is corrected in the infoQ article.

http://www.infoq.com/articles/java-threading-optimizations-p1

Cheers, Jeroen.</description>
		<content:encoded><![CDATA[<p>Thanks Roel.<br />
This blog has actually evolved into a series of two articles on InfoQ. Warming up is indeed way too short here, this is corrected in the infoQ article.</p>
<p><a href="http://www.infoq.com/articles/java-threading-optimizations-p1" rel="nofollow">http://www.infoq.com/articles/java-threading-optimizations-p1</a></p>
<p>Cheers, Jeroen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roel Spilker</title>
		<link>http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/comment-page-1/#comment-54577</link>
		<dc:creator>Roel Spilker</dc:creator>
		<pubDate>Fri, 26 Sep 2008 14:17:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/#comment-54577</guid>
		<description>I&#039;ve modified your code to do 10000 warmup rounds. When I use the -XX:+DoEscapeAnalysis -XX:+Elimi
nateLocks on my machine, I get 39% overhead!!!

java version &quot;1.6.0_06&quot;
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)</description>
		<content:encoded><![CDATA[<p>I&#8217;ve modified your code to do 10000 warmup rounds. When I use the -XX:+DoEscapeAnalysis -XX:+Elimi<br />
nateLocks on my machine, I get 39% overhead!!!</p>
<p>java version &#8220;1.6.0_06&#8243;<br />
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)<br />
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
