Looking at OCaml in the benchmarks game over the past few months

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 better numbers: OCaml needed about 2.45s vs Haskell’s 3.1s, which is what I would have expected. This suggests a serious problem with the benchmark. One more reason to ignore it :slight_smile:

9 Likes