[MLton] Re: [Haskell-cafe] fastest Fibonacci numbers in the West

Matthew Fluet fluet@cs.cornell.edu
Thu, 27 Jan 2005 09:09:10 -0500 (EST)


> Inspired by a discussion on freenode #haskell, I tried to write the
> fastest Fibonacci number function possible, i.e. given a natural
> number input n to compute F_n.
> 
> mlton seems to enjoy substantially better speed despite equivalent
> algorithms; 

As one of the MLton developers, I'm quite glad to hear it.

> For the moment, mlton-generated binaries crash computing fib (10^8-1),

As one of the MLton developers, I'm quite saddened to here it. ;-)
Seriously, if you are getting a segfault or related crash, please report a
bug.  If you are getting an unexpected uncaught exception, we would still 
be interested in hearing more details.

Given that you successfully compute fib (10^7-1), it is clear that you are 
computing the result at IntInf.int.  I don't see any reason why going up 
an order of magnitude would cause any problems.

> and there is a 6:1 speed difference for fib (10^7-1) between the two,
> where mlton-generated binaries take just under 1 minute, and ghc-
> generated binaries take just under 6 minutes.

Again, quite glad to hear it.