I've been having a great deal of fun writing a program to solve this year's
Code Jam "Fair and Square"problem in Haskell (and learning about Haskell in
the process). Having gotten it to work, I've been optimizing it as best I
can. I'm not quite in Captain Ahab mode, but before I let it go I would
like to find out what's behind a difference I've seen compiling and running
the program under Linux and under Windows 7.

Profiling it under Linux (compiled with GHC 7.4.1), it had a total
allocation of 165,375,112 bytes. I had an opportunity to compile and run on
Windows 7, with GHC 7.4.2. I expected it to run faster, since the Windows
computer had a 3.1 GHz i7 and my Linux computer has a 2.8 GHz AMD Propus,
but what I didn't expect was that the total allocation on the Windows
version was 88,438,372 bytes!

Thinking it might be due to a compiler improvement, I upgraded my Linux
computer to Ubuntu 13.04 so I could get a newer GHC, but it didn't make
much difference: total allocation 163,248,688 bytes.

So, I'm wondering: what is it about either the Windows implementation or
GHC 7.4.2 in particular that would make a factor of two difference in
memory allocation? Should anyone wish to compile the program, let me know
the best way to make the source available and I will happily do so; I also
use Twan van Laarhoven's semilattice search tree code available at
http://twanvl.nl/blog/haskell/SemilatticeSearchTree.

James Jones
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to