<?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: Clojure vs Ruby, Part I</title>
	<atom:link href="http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/</link>
	<description>On Ruby, software and the Internet</description>
	<lastBuildDate>Tue, 03 Jan 2012 09:53:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: ajay</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-451</link>
		<dc:creator>ajay</dc:creator>
		<pubDate>Thu, 17 Dec 2009 18:41:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-451</guid>
		<description>One of the nice features that I like a lot is the memoize in Clojure. That makes Dynamic Programming so easy! I no longer have to manually create an array or Hashmap and then fill it in my algorithm. It is automagically taken care off! 

It think that is important to consider memoization too, because memoization in C or Ruby requires a lot additional work.</description>
		<content:encoded><![CDATA[<p>One of the nice features that I like a lot is the memoize in Clojure. That makes Dynamic Programming so easy! I no longer have to manually create an array or Hashmap and then fill it in my algorithm. It is automagically taken care off! </p>
<p>It think that is important to consider memoization too, because memoization in C or Ruby requires a lot additional work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-448</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Thu, 10 Dec 2009 07:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-448</guid>
		<description>Googles Go:
time ./8.out
165580141
./8.out  4,39s user 0,00s system 90% cpu 4,842 total

-----8&lt;--------
     1 package main
     2 import &quot;fmt&quot;;
     3 func fib(n int) int {
     4     if(n&lt;=1){ return 1; }
     5     return fib(n-1) + fib(n-2);
     6 }
     7 func main() {
     8     fmt.Println(fib(40));
     9 }  
-----8&lt;--------</description>
		<content:encoded><![CDATA[<p>Googles Go:<br />
time ./8.out<br />
165580141<br />
./8.out  4,39s user 0,00s system 90% cpu 4,842 total</p>
<p>&#8212;&#8211;8&lt;&#8212;&#8212;&#8211;<br />
     1 package main<br />
     2 import &quot;fmt&quot;;<br />
     3 func fib(n int) int {<br />
     4     if(n&lt;=1){ return 1; }<br />
     5     return fib(n-1) + fib(n-2);<br />
     6 }<br />
     7 func main() {<br />
     8     fmt.Println(fib(40));<br />
     9 }<br />
&#8212;&#8211;8&lt;&#8212;&#8212;&#8211;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Purser-Haskell</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-425</link>
		<dc:creator>Sean Purser-Haskell</dc:creator>
		<pubDate>Fri, 02 Oct 2009 20:27:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-425</guid>
		<description>Is this just a single run of each? Certainly in the case of the JVM I would expect to see significant speedup on subsequent runs (due to JIT compilation). In general a single run doesn&#039;t tell the whole story.</description>
		<content:encoded><![CDATA[<p>Is this just a single run of each? Certainly in the case of the JVM I would expect to see significant speedup on subsequent runs (due to JIT compilation). In general a single run doesn&#8217;t tell the whole story.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-345</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Sun, 24 May 2009 21:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-345</guid>
		<description>Sam: Sure that is not a cached result? I get &quot;Elapsed time: 0.272 msecs&quot; for the first run and and approx 0.04 for subsequent runs.</description>
		<content:encoded><![CDATA[<p>Sam: Sure that is not a cached result? I get &#8220;Elapsed time: 0.272 msecs&#8221; for the first run and and approx 0.04 for subsequent runs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-344</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sun, 24 May 2009 14:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-344</guid>
		<description>I know you&#039;re using a naive fib algorithm for a benchmark, but I just have to post my favorite clojure fibonacci sequence algorithm - it&#039;s very fast and clojure-idiomatic. I didn&#039;t write it, but used it to learn about lazy sequences in clojure.

(def fibonacci-seq
  (lazy-cat [0 1] (map + fibonacci-seq (rest fibonacci-seq))))

user=&gt; (time (nth fibonacci-seq 40))
&quot;Elapsed time: 0.045 msecs&quot;
102334155</description>
		<content:encoded><![CDATA[<p>I know you&#8217;re using a naive fib algorithm for a benchmark, but I just have to post my favorite clojure fibonacci sequence algorithm &#8211; it&#8217;s very fast and clojure-idiomatic. I didn&#8217;t write it, but used it to learn about lazy sequences in clojure.</p>
<p>(def fibonacci-seq<br />
  (lazy-cat [0 1] (map + fibonacci-seq (rest fibonacci-seq))))</p>
<p>user=&gt; (time (nth fibonacci-seq 40))<br />
&#8220;Elapsed time: 0.045 msecs&#8221;<br />
102334155</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-293</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Sun, 28 Dec 2008 05:05:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-293</guid>
		<description>The regular Clojure fib takes about 6.5s to do fib(35) on my machine.  Using the &#039;unchecked&#039; version halves that time.  However, Scala runs fib(35) in approx. 212ms!  What the heck is going on?</description>
		<content:encoded><![CDATA[<p>The regular Clojure fib takes about 6.5s to do fib(35) on my machine.  Using the &#8216;unchecked&#8217; version halves that time.  However, Scala runs fib(35) in approx. 212ms!  What the heck is going on?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Perham</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-292</link>
		<dc:creator>Mike Perham</dc:creator>
		<pubDate>Thu, 25 Dec 2008 03:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-292</guid>
		<description>I chose to test each environment as default because I don&#039;t pretend to be an expert in each.  Isaac wins; his gcc options made a significant improvement:

C (gcc 4.2, -O3 -pipe -Wall -fomit-frame-pointer) 0.9 seconds

Thanks to everyone for your comments.</description>
		<content:encoded><![CDATA[<p>I chose to test each environment as default because I don&#8217;t pretend to be an expert in each.  Isaac wins; his gcc options made a significant improvement:</p>
<p>C (gcc 4.2, -O3 -pipe -Wall -fomit-frame-pointer) 0.9 seconds</p>
<p>Thanks to everyone for your comments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-291</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Wed, 24 Dec 2008 15:26:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-291</guid>
		<description>And your point is what, again?

octave:6&gt; tic;(((1+sqrt(5))/2)**40 - ((1-sqrt(5))/2)**40)/sqrt(5);toc

Elapsed time is 0.000118971 seconds.

A better algorithm beats a better implementation almost any day.</description>
		<content:encoded><![CDATA[<p>And your point is what, again?</p>
<p>octave:6&gt; tic;(((1+sqrt(5))/2)**40 &#8211; ((1-sqrt(5))/2)**40)/sqrt(5);toc</p>
<p>Elapsed time is 0.000118971 seconds.</p>
<p>A better algorithm beats a better implementation almost any day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riaan Minne</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-290</link>
		<dc:creator>Riaan Minne</dc:creator>
		<pubDate>Tue, 23 Dec 2008 10:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-290</guid>
		<description>Yea throw Scala into the mix..!</description>
		<content:encoded><![CDATA[<p>Yea throw Scala into the mix..!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/comment-page-1/#comment-288</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Sat, 20 Dec 2008 09:13:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mikeperham.com/?p=127#comment-288</guid>
		<description>Adam, tail recursion won&#039;t help with this benchmark, because this version of &quot;fib&quot; is not tail recursive.</description>
		<content:encoded><![CDATA[<p>Adam, tail recursion won&#8217;t help with this benchmark, because this version of &#8220;fib&#8221; is not tail recursive.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

