<?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: Revisiting Groovy performance issues</title>
	<atom:link href="http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/</link>
	<description>Software engineering in a computational biology environment</description>
	<lastBuildDate>Mon, 24 Oct 2011 21:36:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: ¿Se puede hacer una GRAN aplicación con Groovy y Grails? &#124; Yo, programador</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-6128</link>
		<dc:creator>¿Se puede hacer una GRAN aplicación con Groovy y Grails? &#124; Yo, programador</dc:creator>
		<pubDate>Wed, 08 Dec 2010 17:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-6128</guid>
		<description>[...] siempre Groovy más lento que Java? no, es posible hacer optimizaciones muy simples en nuestro código para incrementar la [...]</description>
		<content:encoded><![CDATA[<p>[...] siempre Groovy más lento que Java? no, es posible hacer optimizaciones muy simples en nuestro código para incrementar la [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrique</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-4495</link>
		<dc:creator>Enrique</dc:creator>
		<pubDate>Fri, 15 Oct 2010 14:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-4495</guid>
		<description>Have you rerun this test with Groovy 1.7.5? That would show if there have been significant performance improvements since v1.5, 2 and a half years ago.</description>
		<content:encoded><![CDATA[<p>Have you rerun this test with Groovy 1.7.5? That would show if there have been significant performance improvements since v1.5, 2 and a half years ago.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paradigma Tecnológico: La compañía ágil &#187; ¿Se puede hacer una GRAN aplicación con Groovy y Grails?</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-4451</link>
		<dc:creator>Paradigma Tecnológico: La compañía ágil &#187; ¿Se puede hacer una GRAN aplicación con Groovy y Grails?</dc:creator>
		<pubDate>Wed, 13 Oct 2010 09:11:13 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-4451</guid>
		<description>[...] siempre Groovy más lento que Java? no, es posible hacer optimizaciones muy simples en nuestro código para incrementar la [...]</description>
		<content:encoded><![CDATA[<p>[...] siempre Groovy más lento que Java? no, es posible hacer optimizaciones muy simples en nuestro código para incrementar la [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-22</link>
		<dc:creator>Luis</dc:creator>
		<pubDate>Thu, 27 Mar 2008 21:40:52 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-22</guid>
		<description>Good work !. I have some insights regarding JVMs. A round of test (Windows XP, Core2Duo 2GHz, 2GB RAM) showed the following:

Java (Sun 1.6.0_03-b05): 384 sec
Java (JRockit 1.5.0_10): 327 sec

Groovy (Sun 1.6.0_03-b05): 10549 sec
Groovy (JRockit 1.5.0_10):  6375 sec

The ratios:
With Sun 1.6.0_03-b05: 1:27
With JRockit 1.5.0_10: 1:19

Ergo, I prefer JRockit over Sun JVM for groovy development.</description>
		<content:encoded><![CDATA[<p>Good work !. I have some insights regarding JVMs. A round of test (Windows XP, Core2Duo 2GHz, 2GB RAM) showed the following:</p>
<p>Java (Sun 1.6.0_03-b05): 384 sec<br />
Java (JRockit 1.5.0_10): 327 sec</p>
<p>Groovy (Sun 1.6.0_03-b05): 10549 sec<br />
Groovy (JRockit 1.5.0_10):  6375 sec</p>
<p>The ratios:<br />
With Sun 1.6.0_03-b05: 1:27<br />
With JRockit 1.5.0_10: 1:19</p>
<p>Ergo, I prefer JRockit over Sun JVM for groovy development.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Is Groovy 60 Times Slower than Java? &#171; IT Pearls</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-20</link>
		<dc:creator>Is Groovy 60 Times Slower than Java? &#171; IT Pearls</dc:creator>
		<pubDate>Thu, 27 Mar 2008 03:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-20</guid>
		<description>[...] Groovy 60 Times Slower than&#160;Java?  In a pair of very intriguing postings (here and here), Tiago details what he has been observing about the comparative performance of Groovy and [...]</description>
		<content:encoded><![CDATA[<p>[...] Groovy 60 Times Slower than&nbsp;Java?  In a pair of very intriguing postings (here and here), Tiago details what he has been observing about the comparative performance of Groovy and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiago</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-19</link>
		<dc:creator>tiago</dc:creator>
		<pubDate>Tue, 25 Mar 2008 23:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-19</guid>
		<description>It is actually not a sort, but filling up half of a matrix. So I don&#039;t think the bubble/quick sort argument applies.

Also, if it were a complexity problem, the Java version should suffer equally (albeit with a - large - constant difference to the O() case compared to Groovy)</description>
		<content:encoded><![CDATA[<p>It is actually not a sort, but filling up half of a matrix. So I don&#8217;t think the bubble/quick sort argument applies.</p>
<p>Also, if it were a complexity problem, the Java version should suffer equally (albeit with a &#8211; large &#8211; constant difference to the O() case compared to Groovy)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darryl Staflund</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-17</link>
		<dc:creator>Darryl Staflund</dc:creator>
		<pubDate>Tue, 25 Mar 2008 20:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-17</guid>
		<description>Hi there,

The code specified in your initial posting incorporates a bubble-sort algorithm which has a performance factor of Q(n^2) -- not too good, especially as n (the number of elements to be sorted) increases.  If n = 10 million, your code will loop 10 million ^ 2 times, or approximately, 10,000,000,000,000 times.

Your code will perform a lot better if you incorporate a quick-sort algorithm instead, since its performance factor is Q(n log n).  If n = 10 million, your code will loop (10 million) (log 10 million), or approximately, 70,000,000 times -- a vast improvement!

Bubble sorts have the following structure:

    procedure bubbleSort( A : list of sortable items ) defined as:
      do
        swapped := false
        for each i in 0 to length( A ) - 2 do:
          if A[ i ] &gt; A[ i + 1 ] then
            swap( A[ i ], A[ i + 1 ] )
            swapped := true
          end if
        end for
      while swapped
    end procedure


Quicksorts, on the other hand, have the following structure:

   function quicksort(array)
       var list less, equal, greater
       if length(array) ? 1  
           return array  
       select a pivot value pivot from array
       for each x in array
           if x  pivot then append x to greater
       return concatenate(quicksort(less), equal, quicksort(greater))

The other recommendations to this post are all valid, but its the algorithm itself that is your bottleneck.  Hope this helps.

Darryl</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>The code specified in your initial posting incorporates a bubble-sort algorithm which has a performance factor of Q(n^2) &#8212; not too good, especially as n (the number of elements to be sorted) increases.  If n = 10 million, your code will loop 10 million ^ 2 times, or approximately, 10,000,000,000,000 times.</p>
<p>Your code will perform a lot better if you incorporate a quick-sort algorithm instead, since its performance factor is Q(n log n).  If n = 10 million, your code will loop (10 million) (log 10 million), or approximately, 70,000,000 times &#8212; a vast improvement!</p>
<p>Bubble sorts have the following structure:</p>
<p>    procedure bubbleSort( A : list of sortable items ) defined as:<br />
      do<br />
        swapped := false<br />
        for each i in 0 to length( A ) &#8211; 2 do:<br />
          if A[ i ] &gt; A[ i + 1 ] then<br />
            swap( A[ i ], A[ i + 1 ] )<br />
            swapped := true<br />
          end if<br />
        end for<br />
      while swapped<br />
    end procedure</p>
<p>Quicksorts, on the other hand, have the following structure:</p>
<p>   function quicksort(array)<br />
       var list less, equal, greater<br />
       if length(array) ? 1<br />
           return array<br />
       select a pivot value pivot from array<br />
       for each x in array<br />
           if x  pivot then append x to greater<br />
       return concatenate(quicksort(less), equal, quicksort(greater))</p>
<p>The other recommendations to this post are all valid, but its the algorithm itself that is your bottleneck.  Hope this helps.</p>
<p>Darryl</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiago</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-15</link>
		<dc:creator>tiago</dc:creator>
		<pubDate>Mon, 24 Mar 2008 11:53:55 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-15</guid>
		<description>Graeme,

Data? I can get you all the data you need ;)

I am working with data from the public &lt;a href=&quot;http://hapmap.org&quot; rel=&quot;nofollow&quot;&gt;HapMap&lt;/a&gt; project.

Any autosome from &lt;a href=&quot;ftp://ftp.hapmap.org/pub/hapmap/public/genotypes/latest/fwd_strand/redundant-filtered/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, should do fine. I recommend chromosome 22 as it is the smallest autosome (so less data).

&lt;a href=&quot;ftp://ftp.hapmap.org/pub/hapmap/public/genotypes/latest/fwd_strand/redundant-filtered/genotypes_chr21_YRI_r23_QC+.b36_fwd.txt.gz&quot; rel=&quot;nofollow&quot;&gt;Yoruban 21&lt;/a&gt; - Still one of the smallest, should work directly (change the directory only on the BufferedReader line) with the groovy code (which only processes one chromosome from one population. The Java code does all autosomes of Yorubans and Utahans).</description>
		<content:encoded><![CDATA[<p>Graeme,</p>
<p>Data? I can get you all the data you need <img src='http://tiago.org/cc/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I am working with data from the public <a href="http://hapmap.org" rel="nofollow">HapMap</a> project.</p>
<p>Any autosome from <a href="ftp://ftp.hapmap.org/pub/hapmap/public/genotypes/latest/fwd_strand/redundant-filtered/" rel="nofollow">here</a>, should do fine. I recommend chromosome 22 as it is the smallest autosome (so less data).</p>
<p><a href="ftp://ftp.hapmap.org/pub/hapmap/public/genotypes/latest/fwd_strand/redundant-filtered/genotypes_chr21_YRI_r23_QC+.b36_fwd.txt.gz" rel="nofollow">Yoruban 21</a> &#8211; Still one of the smallest, should work directly (change the directory only on the BufferedReader line) with the groovy code (which only processes one chromosome from one population. The Java code does all autosomes of Yorubans and Utahans).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graeme Rocher</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-13</link>
		<dc:creator>Graeme Rocher</dc:creator>
		<pubDate>Mon, 24 Mar 2008 11:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-13</guid>
		<description>It would be useful if you could post a sample of the data you were using, even if only a subset of it. Otherwise others can&#039;t try out the code</description>
		<content:encoded><![CDATA[<p>It would be useful if you could post a sample of the data you were using, even if only a subset of it. Otherwise others can&#8217;t try out the code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tiago</title>
		<link>http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/comment-page-1/#comment-12</link>
		<dc:creator>tiago</dc:creator>
		<pubDate>Mon, 24 Mar 2008 11:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://tiago.org/cc/2008/03/23/revisiting-groovy-performance-issues/#comment-12</guid>
		<description>Hi,

I have put the code &lt;a href=&quot;http://tiago.org/groovypost/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; (Along with the Java version).

I would like to thank everybody that offered to help. I have sorted this out in Java and for me it is a done deal.

But we could use this exercise in order to understand and document possible groovy performance pitfalls. So, if you have any suggestions to enhance the code feel free to comment, so that we can help others in not making the mistakes that I have done.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have put the code <a href="http://tiago.org/groovypost/" rel="nofollow">here</a> (Along with the Java version).</p>
<p>I would like to thank everybody that offered to help. I have sorted this out in Java and for me it is a done deal.</p>
<p>But we could use this exercise in order to understand and document possible groovy performance pitfalls. So, if you have any suggestions to enhance the code feel free to comment, so that we can help others in not making the mistakes that I have done.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

