Re: For performance, write it in OCaml



William James wrote:
Here's an OCaml version that runs in about 1.5 seconds when
output is redirected to a file on my faster computer (3.2 GHz).
It uses the same algorithm as the C program.
The C version takes 1.961 seconds when writing to /dev/null on
the o.p.'s computer. Since this is my first OCaml program, I'm
certain an expert could improve it.


An expert did suggest replacing a couple of lists with arrays.
This should be a bit faster.
*This* expert suggests comparing performance between the C version and the Ocaml version on the *same* machine! :)


.