[Haskell-cafe] Help optimize fannkuch program

Branimir Maksimovic bmaxa at hotmail.com
Mon Dec 3 20:18:42 CET 2012


Thanks. Your version is much faster.Yes, I have compiled with ghc --make -O2 -fllvm -optlo-O3 -optlo-constprop fannkuchredux4.hs(there is bug in ghc 7.4.2 regarding llvm 3.1 > which is circumvented with constrprop)
results: yours:bmaxa at maxa:~/shootout/fannkuchredux$ time ./fannkuchredux4 123968050Pfannkuchen(12) = 65
real    0m39.200suser    0m39.132ssys     0m0.044s
mine:bmaxa at maxa:~/shootout/fannkuchredux$ time ./fannkuchredux 123968050Pfannkuchen(12) = 65
real    0m50.784suser    0m50.660ssys     0m0.092s
Seems that you machine is faster than mine and somewhat better for executing mine version.Thanks ! Should I contribute your version on shootout site?

Date: Mon, 3 Dec 2012 00:01:32 -0800
Subject: Re: [Haskell-cafe] Help optimize fannkuch program
From: bos at serpentine.com
To: bmaxa at hotmail.com
CC: haskell-cafe at haskell.org

On Sun, Dec 2, 2012 at 3:12 PM, Branimir Maksimovic <bmaxa at hotmail.com> wrote:

Well, playing with Haskell I have literally trasnlated my c++ program http://shootout.alioth.debian.org/u64q/program.php?test=fannkuchredux&lang=gpp&id=3
and got decent performance but not that good in comparisonwith c++ On my machine Haskell runs 52 secs while c++ 30 secs.
Did you compile with -O2 -fllvm?

On my machine:
C++ 28 secMine -O2 -fllvm 37 secYours -O2 -fllvm 41 secMine -O2 48 secYours -O2 54 sec
My version of your Haskell code is here: http://hpaste.org/78705 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121203/f688e3ae/attachment.htm>


More information about the Haskell-Cafe mailing list