jfeser:
For the pidigits benchmark, the F# code uses GMP through its FFI and the OCaml code uses it through Zarith. I’m a little surprised by the performance difference in this one, since the implementations seem quite similar.
Not that I typically cared about these kinds of benchmarks, but it seemed strange to me that OCaml could possibly perform less efficiently than some of these languages. I’ve just picked one benchmark that caught my eye (pidigits), where OCaml needed 11.04 seconds against Haskell’s 4.22 seconds. That seemed preposterous given that both languages should be using GMP and spend most of their time in that library.
Running this benchmark on my computer for both Haskell and OCaml, I get considerably…
The pidigits comparison has come up before as well. I get similar numbers to what’s shared in the other post, which suggests that there could’ve been an issue with how the benchmark was run in the original post.