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

Matthew Fluet fluet@cs.cornell.edu
Thu, 27 Jan 2005 13:56:47 -0500 (EST)


> I think a good thing to check would be a C version using libgmp.
> That might help in determining if MLton has any of the blame...

I think this FAQ entry from the GnuMP website explains it.

Q:  I get a Segfault/Bus error in a program that uses GMP to calculate
numbers with several hundred thousand digits. Why?

A: GMP allocates most temporaries on the stack, and some machines give
user programs very little stack space by default. See setrlimit(2) for
information on how to increase the stack allocation. You can also change
it from the shell (using ulimit or limit depending on the shell). You can
also configure with --disable-alloca to instead allocate temporaries using
malloc, but that will make the library run somewhat slower.