<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Code movement in Java programs with pure functions</title>
	<atom:link href="http://purejava.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://purejava.wordpress.com</link>
	<description>A journal of my research for a BSc (Hons) project at VUW</description>
	<lastBuildDate>Fri, 22 Aug 2008 09:00:17 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on You are doing it wrong&#8230; by qwandor</title>
		<link>http://purejava.wordpress.com/2008/08/21/you-are-doing-it-wrong/#comment-58</link>
		<dc:creator>qwandor</dc:creator>
		<pubDate>Fri, 22 Aug 2008 09:00:17 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=43#comment-58</guid>
		<description>If I were trying to optimise a particular program, then I would agree with you Dmitry. However, the aim of this project is to prototype a new compiler optimisation based on using knowledge of pure methods (and other properties of classes and methods) to do loop invariant code movement that would not otherwise be possible. As such I am trying at the moment to find cases where the existing optimisations in HotSpot&#039;s JIT (for example) cannot be applied as it does not know enough about the structure of the program, but my optimisations can safely be applied and improve performance.

It seems that such cases are not as common as I had hoped. However, I have just this evening been looking at other JVMs that do not do so much optimisation at runtime, and in these cases my compile-time optimisations do seem to be worthwhile. I will post some more about this shortly.</description>
		<content:encoded><![CDATA[<p>If I were trying to optimise a particular program, then I would agree with you Dmitry. However, the aim of this project is to prototype a new compiler optimisation based on using knowledge of pure methods (and other properties of classes and methods) to do loop invariant code movement that would not otherwise be possible. As such I am trying at the moment to find cases where the existing optimisations in HotSpot&#8217;s JIT (for example) cannot be applied as it does not know enough about the structure of the program, but my optimisations can safely be applied and improve performance.</p>
<p>It seems that such cases are not as common as I had hoped. However, I have just this evening been looking at other JVMs that do not do so much optimisation at runtime, and in these cases my compile-time optimisations do seem to be worthwhile. I will post some more about this shortly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on You are doing it wrong&#8230; by Dmitry</title>
		<link>http://purejava.wordpress.com/2008/08/21/you-are-doing-it-wrong/#comment-57</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Fri, 22 Aug 2008 08:33:01 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=43#comment-57</guid>
		<description>You should first profile the application to identify the bottlenecks, then optimize those bottlenecks, then repeat. This is much more effective than mechanically applying a trivial optimization throughout the entire code base. 

Two good Java profilers are JProfiler and Yourkit.</description>
		<content:encoded><![CDATA[<p>You should first profile the application to identify the bottlenecks, then optimize those bottlenecks, then repeat. This is much more effective than mechanically applying a trivial optimization throughout the entire code base. </p>
<p>Two good Java profilers are JProfiler and Yourkit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on You are doing it wrong&#8230; by qwandor</title>
		<link>http://purejava.wordpress.com/2008/08/21/you-are-doing-it-wrong/#comment-56</link>
		<dc:creator>qwandor</dc:creator>
		<pubDate>Fri, 22 Aug 2008 00:17:25 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=43#comment-56</guid>
		<description>Okay, by reducing the amount of &#039;optimisation&#039; I do (only moving expressions out of loops if they actually contain method calls or field dereferences), I can get more reasonable times, but still not any faster than the unoptimised build:
&lt;code&gt;
real    0m3.441s
user    0m3.282s
sys     0m0.051s

real    0m3.442s
user    0m3.295s
sys     0m0.040s
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Okay, by reducing the amount of &#8216;optimisation&#8217; I do (only moving expressions out of loops if they actually contain method calls or field dereferences), I can get more reasonable times, but still not any faster than the unoptimised build:<br />
<code><br />
real    0m3.441s<br />
user    0m3.282s<br />
sys     0m0.051s</p>
<p>real    0m3.442s<br />
user    0m3.295s<br />
sys     0m0.040s<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Testing manual optimisation by More tests &#171; Code movement in Java programs with pure functions</title>
		<link>http://purejava.wordpress.com/2008/08/19/testing-manual-optimisation/#comment-54</link>
		<dc:creator>More tests &#171; Code movement in Java programs with pure functions</dc:creator>
		<pubDate>Thu, 21 Aug 2008 02:24:32 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=36#comment-54</guid>
		<description>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &#171; Testing manual&#160;optimisation [...]</description>
		<content:encoded><![CDATA[<p>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &laquo; Testing manual&nbsp;optimisation [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Testing manual optimisation by qwandor</title>
		<link>http://purejava.wordpress.com/2008/08/19/testing-manual-optimisation/#comment-53</link>
		<dc:creator>qwandor</dc:creator>
		<pubDate>Thu, 21 Aug 2008 01:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=36#comment-53</guid>
		<description>Thanks Dmitry, that confirms what I was suspecting. I assume that HotSpot is inlining short methods when it can work out statically what methods are actually called.</description>
		<content:encoded><![CDATA[<p>Thanks Dmitry, that confirms what I was suspecting. I assume that HotSpot is inlining short methods when it can work out statically what methods are actually called.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Testing manual optimisation by Dmitry</title>
		<link>http://purejava.wordpress.com/2008/08/19/testing-manual-optimisation/#comment-52</link>
		<dc:creator>Dmitry</dc:creator>
		<pubDate>Wed, 20 Aug 2008 07:12:22 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=36#comment-52</guid>
		<description>First, HotSpot Server optimizes your loops away as they do not compute any result. You should do something inside the loops, and make sure the result is not thrown away, otherwise the results are meaningless. Google for something like &quot;common microbenchmarking mistakes&quot;.

Second, HotSpot Server is capable of detecting that array.length and list.size() are loop invariants. If you have some code inside the loops that _may_ potentially change  &#039;array&#039; or &#039;list&#039;, your manual optimization would come into play.</description>
		<content:encoded><![CDATA[<p>First, HotSpot Server optimizes your loops away as they do not compute any result. You should do something inside the loops, and make sure the result is not thrown away, otherwise the results are meaningless. Google for something like &#8220;common microbenchmarking mistakes&#8221;.</p>
<p>Second, HotSpot Server is capable of detecting that array.length and list.size() are loop invariants. If you have some code inside the loops that _may_ potentially change  &#8216;array&#8217; or &#8216;list&#8217;, your manual optimization would come into play.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Milestone 1 by Presentation &#171; Code movement in Java programs with pure functions</title>
		<link>http://purejava.wordpress.com/2008/05/09/milestone-1/#comment-32</link>
		<dc:creator>Presentation &#171; Code movement in Java programs with pure functions</dc:creator>
		<pubDate>Fri, 16 May 2008 00:12:38 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=12#comment-32</guid>
		<description>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &#171; Milestone&#160;1 [...]</description>
		<content:encoded><![CDATA[<p>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &laquo; Milestone&nbsp;1 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A first simple optimisation by This time, maybe? &#171; Code movement in Java programs with pure functions</title>
		<link>http://purejava.wordpress.com/2008/04/25/a-first-simple-optimisation/#comment-16</link>
		<dc:creator>This time, maybe? &#171; Code movement in Java programs with pure functions</dc:creator>
		<pubDate>Wed, 30 Apr 2008 03:55:52 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=10#comment-16</guid>
		<description>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &#171; A first simple&#160;optimisation [...]</description>
		<content:encoded><![CDATA[<p>[...] Code movement in Java programs with pure functions A journal of my research for a BSc (Hons) project at VUW      &laquo; A first simple&nbsp;optimisation [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction by qwandor</title>
		<link>http://purejava.wordpress.com/2008/03/25/introduction/#comment-3</link>
		<dc:creator>qwandor</dc:creator>
		<pubDate>Fri, 28 Mar 2008 05:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=4#comment-3</guid>
		<description>It looks like I forgot. Oops.</description>
		<content:encoded><![CDATA[<p>It looks like I forgot. Oops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction by Neil Walbran</title>
		<link>http://purejava.wordpress.com/2008/03/25/introduction/#comment-2</link>
		<dc:creator>Neil Walbran</dc:creator>
		<pubDate>Thu, 27 Mar 2008 22:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://purejava.wordpress.com/?p=4#comment-2</guid>
		<description>How come objective 4 of your research proposal doesn&#039;t have any time allocated to it?</description>
		<content:encoded><![CDATA[<p>How come objective 4 of your research proposal doesn&#8217;t have any time allocated to it?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
