[MLton-user] timing anomoly

Vesa Karvonen vesa.a.j.k at gmail.com
Tue Dec 4 11:12:02 PST 2007


On Dec 4, 2007 6:48 PM, Sean McLaughlin <seanmcl at gmail.com> wrote:
> Fair enough :)
>
> However, is it possible to make this code run faster?  It currently runs
> over 3X slower than the equivalent C program:
[...]

I compiled the code snippets with both MLton and gcc (-O2) and
inspected the generated assembly code.  What is happening here is that
gcc eliminates most of the floating point computation.  Note that all
of your "x" variables are constants.  You should read the "x" values
from some run-time input for a more meaningful benchmark.

-Vesa Karvonen



More information about the MLton-user mailing list