<?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: Another Reason Java is Faster than C (maybe)</title>
	<atom:link href="http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/</link>
	<description>Ranting and Raving</description>
	<lastBuildDate>Wed, 28 Jul 2010 09:12:38 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Elliotte Rusty Harold</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-183176</link>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
		<pubDate>Wed, 14 Nov 2007 12:31:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-183176</guid>
		<description>For many applications, yes. However for any long-running application the JIT overhead is negligible. JIT compilation time is fixed and finite. A long-running app like a server amortizes this over a long enough period that you won&#039;t notice it.</description>
		<content:encoded><![CDATA[<p>For many applications, yes. However for any long-running application the JIT overhead is negligible. JIT compilation time is fixed and finite. A long-running app like a server amortizes this over a long enough period that you won&#8217;t notice it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Dinse</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-181970</link>
		<dc:creator>Robert Dinse</dc:creator>
		<pubDate>Tue, 13 Nov 2007 13:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-181970</guid>
		<description>Just-in-time compilers have the overhead of compiling prior to executing the code; a binary object doesn&#039;t have that overhead.  For many applications, the compilation overhead is going to outweigh any microcode tuning advantage.  More often than not where x86 architecture is concerned, you&#039;re talking about specialized instructions for video decoding or 3d graphics and not real general purpose functions that will be used by code designed to be platform independent like Java. With respect to Linux, grab the source and compile it yourself, optimized for the platform you&#039;re compiling on. Yes, most distributions are going to compile for the lowest common denominator, truth be told in most areas that won&#039;t matter. But for the kernel and critical code, anything floating point or graphics intensive; compile yourself for the platform for best performance.</description>
		<content:encoded><![CDATA[<p>Just-in-time compilers have the overhead of compiling prior to executing the code; a binary object doesn&#8217;t have that overhead.  For many applications, the compilation overhead is going to outweigh any microcode tuning advantage.  More often than not where x86 architecture is concerned, you&#8217;re talking about specialized instructions for video decoding or 3d graphics and not real general purpose functions that will be used by code designed to be platform independent like Java. With respect to Linux, grab the source and compile it yourself, optimized for the platform you&#8217;re compiling on. Yes, most distributions are going to compile for the lowest common denominator, truth be told in most areas that won&#8217;t matter. But for the kernel and critical code, anything floating point or graphics intensive; compile yourself for the platform for best performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Berger</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-55930</link>
		<dc:creator>Frank Berger</dc:creator>
		<pubDate>Tue, 20 Mar 2007 07:47:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-55930</guid>
		<description>@Lawrence &lt;em&gt;A Java program would be little compiled (JIT) and most interpreted by a jvm.&lt;/em&gt;
How do you get that idea? Hotspot compiles often used code and interprets the rest.... What percentage this is depends on the programm

&lt;em&gt;On linux this jvm would be probably compiled for 386 to support all platform, or not ? &lt;/em&gt; Why should a Java compiler currently running, let&#039;s say on an X64 stay compatible with an 386? It&#039;s compiled at runtime and thrown away at the end of the program. The compiled code has never to run on an 386. It will compile code for a genuine 386 only if it runs on a 386</description>
		<content:encoded><![CDATA[<p>@Lawrence <em>A Java program would be little compiled (JIT) and most interpreted by a jvm.</em><br />
How do you get that idea? Hotspot compiles often used code and interprets the rest&#8230;. What percentage this is depends on the programm</p>
<p><em>On linux this jvm would be probably compiled for 386 to support all platform, or not ? </em> Why should a Java compiler currently running, let&#8217;s say on an X64 stay compatible with an 386? It&#8217;s compiled at runtime and thrown away at the end of the program. The compiled code has never to run on an 386. It will compile code for a genuine 386 only if it runs on a 386</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-54415</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Thu, 15 Mar 2007 16:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-54415</guid>
		<description>IBM&#039;s JITC is supposed to have been doing that since at least 1999.  E.g., &quot;Simple code scheduling within a basic block is applied to reorder the instructions so that they best fit the requirements of the underlying machine. The JIT compiler has a potential advantage over the traditional compilation technique in that it can identify the type of machine it is running on, and we make use of this information in both code generation and code scheduling.&quot; and 
&quot;Different machine instructions are selected, depending on the underlying processor type for some bytecode instructions.&quot;  (http://www.research.ibm.com/journal/sj/391/suganuma.html)

I&#039;ve always presumed that Sun&#039;s HotSpot works similar magic; emphasizing SPARC architectures until they started getting serious about selling x86 based machines.  They do have at least one related patent anyway (http://www.patentstorm.us/patents/6139199-description.html)

Given the awareness that a JVM can have of the characteristics  of the actual hardware it is running on I&#039;ve always been surprised that Java hasn&#039;t beaten C more frequently.</description>
		<content:encoded><![CDATA[<p>IBM&#8217;s JITC is supposed to have been doing that since at least 1999.  E.g., &#8220;Simple code scheduling within a basic block is applied to reorder the instructions so that they best fit the requirements of the underlying machine. The JIT compiler has a potential advantage over the traditional compilation technique in that it can identify the type of machine it is running on, and we make use of this information in both code generation and code scheduling.&#8221; and<br />
&#8220;Different machine instructions are selected, depending on the underlying processor type for some bytecode instructions.&#8221;  (<a href="http://www.research.ibm.com/journal/sj/391/suganuma.html" rel="nofollow">http://www.research.ibm.com/journal/sj/391/suganuma.html</a>)</p>
<p>I&#8217;ve always presumed that Sun&#8217;s HotSpot works similar magic; emphasizing SPARC architectures until they started getting serious about selling x86 based machines.  They do have at least one related patent anyway (<a href="http://www.patentstorm.us/patents/6139199-description.html" rel="nofollow">http://www.patentstorm.us/patents/6139199-description.html</a>)</p>
<p>Given the awareness that a JVM can have of the characteristics  of the actual hardware it is running on I&#8217;ve always been surprised that Java hasn&#8217;t beaten C more frequently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-54258</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Wed, 14 Mar 2007 23:51:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-54258</guid>
		<description>Well wait. A Java program would be little compiled (JIT) and most interpreted by a jvm.
On linux this jvm would be probably compiled for 386 to support all platform, or not ?</description>
		<content:encoded><![CDATA[<p>Well wait. A Java program would be little compiled (JIT) and most interpreted by a jvm.<br />
On linux this jvm would be probably compiled for 386 to support all platform, or not ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicolás Lichtmaier</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-53997</link>
		<dc:creator>Nicolás Lichtmaier</dc:creator>
		<pubDate>Wed, 14 Mar 2007 00:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-53997</guid>
		<description>Indeed... doesn&#039;t some media players include optimized versions of some some parts of their code for different x86 variants?</description>
		<content:encoded><![CDATA[<p>Indeed&#8230; doesn&#8217;t some media players include optimized versions of some some parts of their code for different x86 variants?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xan Gregg</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-53936</link>
		<dc:creator>Xan Gregg</dc:creator>
		<pubDate>Tue, 13 Mar 2007 20:08:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-53936</guid>
		<description>When I did some Java vs. C benchmarks a couple years ago (http://www.forthgo.com/blog/java-vs-c-vs-c-at-finding-primes/), I noticed in passing that moving from 64-bit integers to 32-bit integers gave C a big improvement but hardly affected the Java times. I assumed that the JVM noticed that I was running on a 64-bit machine and customized the code for it, but the C compiler had to lock-in early on 32-bit instructions and couldn&#039;t use 64-bit instructions directly. Thus 64-bit integers were costly for C even on a 64-bit machine.

Now, if only they&#039;d get the Range Check Elimination Optimization to be useful (by adding static analysis), they&#039;d be able to really compete on speed.</description>
		<content:encoded><![CDATA[<p>When I did some Java vs. C benchmarks a couple years ago (<a href="http://www.forthgo.com/blog/java-vs-c-vs-c-at-finding-primes/" rel="nofollow">http://www.forthgo.com/blog/java-vs-c-vs-c-at-finding-primes/</a>), I noticed in passing that moving from 64-bit integers to 32-bit integers gave C a big improvement but hardly affected the Java times. I assumed that the JVM noticed that I was running on a 64-bit machine and customized the code for it, but the C compiler had to lock-in early on 32-bit instructions and couldn&#8217;t use 64-bit instructions directly. Thus 64-bit integers were costly for C even on a 64-bit machine.</p>
<p>Now, if only they&#8217;d get the Range Check Elimination Optimization to be useful (by adding static analysis), they&#8217;d be able to really compete on speed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://www.elharo.com/blog/software-development/java/2007/03/12/another-reason-java-is-faster-than-c-maybe/comment-page-1/#comment-53896</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Tue, 13 Mar 2007 16:36:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/2007/03/12/another-reason-java-is-faster-than-c-maybe/#comment-53896</guid>
		<description>C is only hobbled in this regard when a compiled program is limited to a single architecture.

Fat Mach-O executables can contain any number of architectures or micro-architectures.

In other words, this isn&#039;t a C vs. Java problem, it&#039;s an object-file problem.</description>
		<content:encoded><![CDATA[<p>C is only hobbled in this regard when a compiled program is limited to a single architecture.</p>
<p>Fat Mach-O executables can contain any number of architectures or micro-architectures.</p>
<p>In other words, this isn&#8217;t a C vs. Java problem, it&#8217;s an object-file problem.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
