<?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: Looks like Apple should &#8220;switch&#8221;</title> <atom:link href="http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/feed/" rel="self" type="application/rss+xml" /><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/</link> <description>Rants about Java and other internet technologies by Sam Pullara</description> <lastBuildDate>Wed, 18 Jan 2012 14:14:00 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>By: Robert Chin</title><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/comment-page-1/#comment-1513</link> <dc:creator>Robert Chin</dc:creator> <pubDate>Fri, 27 May 2011 01:18:00 +0000</pubDate> <guid
isPermaLink="false">http://www.javarants.com/?p=1062#comment-1513</guid> <description>In case anyone is wondering why the performance benchmark shows such a large difference (aside from the possibility of the compare being optimized out as stated by alastair) -- the Objective-C method that is being used is compare:, which is a fully unicode aware function that compares based on the ordering of fully composed unicode characters. It is likely that this method also takes into account the user&#039;s locale in order to ascertain the ordering (although I&#039;m unsure about this last part). But the string does need to be re-composed in order for the search to work correctly. Java&#039;s compareTo: is not specifically unicode aware, and the documentation states that it the unicode character value (which is not necessarily &quot;correct&quot; when dealing with decomposed strings). To make a fair comparison, the java code should probably use java.text.Collator.</description> <content:encoded><![CDATA[<p>In case anyone is wondering why the performance benchmark shows such a large difference (aside from the possibility of the compare being optimized out as stated by alastair) &#8212; the Objective-C method that is being used is compare:, which is a fully unicode aware function that compares based on the ordering of fully composed unicode characters. It is likely that this method also takes into account the user&#8217;s locale in order to ascertain the ordering (although I&#8217;m unsure about this last part). But the string does need to be re-composed in order for the search to work correctly. Java&#8217;s compareTo: is not specifically unicode aware, and the documentation states that it the unicode character value (which is not necessarily &#8220;correct&#8221; when dealing with decomposed strings). To make a fair comparison, the java code should probably use java.text.Collator.</p> ]]></content:encoded> </item> <item><title>By: Random Dude.</title><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/comment-page-1/#comment-1509</link> <dc:creator>Random Dude.</dc:creator> <pubDate>Wed, 18 May 2011 11:35:00 +0000</pubDate> <guid
isPermaLink="false">http://www.javarants.com/?p=1062#comment-1509</guid> <description>In objective-C, if you make the same method call over and over again, doesn&#039;t it store it in a cache. 
Forgive me if this is a dumb question ;)</description> <content:encoded><![CDATA[<p>In objective-C, if you make the same method call over and over again, doesn&#8217;t it store it in a cache. <br
/> Forgive me if this is a dumb question <img
src='http://www.javarants.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: alastair</title><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/comment-page-1/#comment-1170</link> <dc:creator>alastair</dc:creator> <pubDate>Thu, 27 May 2010 21:40:14 +0000</pubDate> <guid
isPermaLink="false">http://www.javarants.com/?p=1062#comment-1170</guid> <description>Interestingly I just fiddled with the Java code a bit and got it going faster, without the comparisons (up to 8.3x10^7 a second).&lt;br&gt;&lt;br&gt;Still, as I say, I think your benchmark is of dubious validity; I&#039;m not enough of a Java fiend to know how to stop the compiler/JIT from optimising away parts of your code that should really be being timed, and you can&#039;t really claim that Java is faster on the basis that it can optimise away the computation you were trying to time.</description> <content:encoded><![CDATA[<p>Interestingly I just fiddled with the Java code a bit and got it going faster, without the comparisons (up to 8.3&#215;10^7 a second).</p><p>Still, as I say, I think your benchmark is of dubious validity; I&#39;m not enough of a Java fiend to know how to stop the compiler/JIT from optimising away parts of your code that should really be being timed, and you can&#39;t really claim that Java is faster on the basis that it can optimise away the computation you were trying to time.</p> ]]></content:encoded> </item> <item><title>By: alastair</title><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/comment-page-1/#comment-1167</link> <dc:creator>alastair</dc:creator> <pubDate>Thu, 27 May 2010 21:30:21 +0000</pubDate> <guid
isPermaLink="false">http://www.javarants.com/?p=1062#comment-1167</guid> <description>Unfortunately, what you&#039;re comparing here isn&#039;t the language; it&#039;s the efficiency of the string comparison routine in the relevant library; in fact, for Java I&#039;m not even sure you&#039;re measuring *that* properly. Removing the actual comparisons from the code and replacing them with 1, 0 and -1, on a Mac Pro I get:&lt;br&gt;&lt;br&gt;Java: 345065.5624568668 compare tests / second&lt;br&gt;C: inf (it&#039;s too fast for your timing method and you&#039;d have to change the code!)&lt;br&gt;ObjC: 1644439.299682 compare tests / second&lt;br&gt;&lt;br&gt;Also, I noticed that the numbers for Java really didn&#039;t change when I removed the comparisons, which makes me think that perhaps the Java compiler or JIT is optimising away the calls to the compareTo() method. You might say, well then it&#039;s faster… but of course that&#039;s only true for this synthetic benchmark, not in the real world. It&#039;s pretty clear from the numbers here that C and ObjC are faster languages, since all we&#039;re measuring here is function call/method overhead.</description> <content:encoded><![CDATA[<p>Unfortunately, what you&#39;re comparing here isn&#39;t the language; it&#39;s the efficiency of the string comparison routine in the relevant library; in fact, for Java I&#39;m not even sure you&#39;re measuring *that* properly. Removing the actual comparisons from the code and replacing them with 1, 0 and -1, on a Mac Pro I get:</p><p>Java: 345065.5624568668 compare tests / second<br
/>C: inf (it&#39;s too fast for your timing method and you&#39;d have to change the code!)<br
/>ObjC: 1644439.299682 compare tests / second</p><p>Also, I noticed that the numbers for Java really didn&#39;t change when I removed the comparisons, which makes me think that perhaps the Java compiler or JIT is optimising away the calls to the compareTo() method. You might say, well then it&#39;s faster… but of course that&#39;s only true for this synthetic benchmark, not in the real world. It&#39;s pretty clear from the numbers here that C and ObjC are faster languages, since all we&#39;re measuring here is function call/method overhead.</p> ]]></content:encoded> </item> <item><title>By: Android Dalvik VM performance is a threat to the iPhone &#124; java rants</title><link>http://www.javarants.com/2004/05/04/looks-like-apple-should-switch/comment-page-1/#comment-1081</link> <dc:creator>Android Dalvik VM performance is a threat to the iPhone &#124; java rants</dc:creator> <pubDate>Wed, 26 May 2010 16:35:31 +0000</pubDate> <guid
isPermaLink="false">http://www.javarants.com/?p=1062#comment-1081</guid> <description>[...] libraries. Those are mostly Objective-C libraries and use the dynamic dispatch mechanism which I showed in 2004 was very much slower than Java.  I&#8217;d really love to see the whole computer language shootout written with Objective-C [...]</description> <content:encoded><![CDATA[<p>[...] libraries. Those are mostly Objective-C libraries and use the dynamic dispatch mechanism which I showed in 2004 was very much slower than Java.  I&#8217;d really love to see the whole computer language shootout written with Objective-C [...]</p> ]]></content:encoded> </item> </channel> </rss>
