The Computer Language
Benchmarks Game

F# .NET versus OCaml fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
F# .NET 2.85 1,301,192 611 7.36 51% 92% 59% 56%
OCaml 14.66 816,136 637 14.72 0% 100% 0% 0%
k-nucleotide
source secs mem gz busy cpu load
F# .NET 3.65 184,680 1907 12.58 94% 84% 85% 83%
OCaml 15.09 255,396 1833 40.72 38% 94% 64% 74%
spectral-norm
source secs mem gz busy cpu load
F# .NET 1.55 31,916 853 5.83 92% 98% 93% 93%
OCaml 5.36 3,448 377 5.36 0% 0% 0% 100%
fasta
source secs mem gz busy cpu load
F# .NET 1.14 120,528 1350 4.18 94% 94% 89% 91%
OCaml 3.28 203,300 1189 3.29 0% 0% 100% 0%
mandelbrot
source secs mem gz busy cpu load
F# .NET 3.77 64,912 933 14.73 99% 97% 98% 97%
OCaml 7.53 4,480 717 30.02 100% 100% 100% 100%
reverse-complement
source secs mem gz busy cpu load
F# .NET 1.51 1,030,852 1140 4.19 93% 36% 58% 91%
OCaml 1.68 34,024 1368 4.31 56% 57% 75% 69%
pidigits
source secs mem gz busy cpu load
F# .NET 0.82 34,428 905 0.83 1% 2% 96% 1%
OCaml 0.89 5,968 593 0.90 0% 0% 1% 100%
fannkuch-redux
source secs mem gz busy cpu load
F# .NET 8.65 31,784 1097 33.57 98% 99% 94% 98%
OCaml 8.66 18,900 1004 34.60 100% 100% 100% 100%
n-body
source secs mem gz busy cpu load
F# .NET 6.88 34,744 1617 6.92 0% 100% 1% 0%
OCaml 6.70 1,468 1251 6.70 100% 0% 0% 0%
binary-trees
source secs mem gz busy cpu load
F# .NET 6.06 1,469,616 516 16.18 63% 69% 62% 72%
OCaml 4.68 152,716 751 13.23 78% 99% 42% 64%
F# .NET

.NET SDK 5.0.100
Host Version: 5.0.0; Commit: cf258a14b7
<ServerGarbageCollection>true</ServerGarbageCollection>

OCaml

The OCaml native-code compiler, version 4.12.0