The Computer Language
22.05 Benchmarks Game

Fastest cpu secs OCaml versus F# .NET

Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more cpu seconds, less gz source code.

fannkuch-redux
source mem gz cpu
F# .NET #6 32,752 1097 33.86
OCaml #3 13,992 1017 35.84
OCaml #4 19,812 1004 35.88
F# .NET #5 37,736 912 41.06
OCaml #2 2,012 473 45.04
OCaml 2,036 524 52.69
n-body
source mem gz cpu
F# .NET #6 37,180 1383 4.99
F# .NET #5 37,244 1351 6.31
F# .NET #3 35,620 1617 6.84
OCaml 1,748 1251 6.91
F# .NET #4 34,136 1290 6.91
F# .NET #2 37,376 1381 7.22
F# .NET   Bad Output  
spectral-norm
source mem gz cpu
OCaml #2 3,932 377 5.32
F# .NET #2 33,212 853 5.80
F# .NET #4 34,468 732 5.80
mandelbrot
source mem gz cpu
F# .NET #6 66,476 933 14.65
F# .NET #5 66,724 897 15.54
F# .NET 66,700 877 15.67
OCaml #6 3,252 444 28.23
OCaml 4,808 717 30.01
pidigits
source mem gz cpu
OCaml #7 6,260 593 0.74
F# .NET #6 34,380 905 0.80
F# .NET #4 35,412 874 1.28
OCaml #5 18,960 458 3.47
regex-redux
source mem gz cpu
OCaml #3 525,884 647 4.18
F# .NET #7 1,219,132 599 5.82
F# .NET #6 1,061,172 611 7.26
OCaml #2 865,972 637 14.16
fasta
source mem gz cpu
OCaml #6 203,384 1189 3.31
F# .NET #3 79,888 1350 4.13
OCaml #3 2,828 1071 4.65
F# .NET #4 57,276 1342 5.84
k-nucleotide
source mem gz cpu
F# .NET #6 183,708 1907 12.55
F# .NET #2 198,604 1926 16.92
OCaml #3 255,644 1833 44.08
OCaml #2   Make Error  
OCaml   Make Error  
reverse-complement
source mem gz cpu
F# .NET #5 1,030,932 1140 4.29
F# .NET #4 1,030,720 1139 4.43
OCaml 34,432 1368 4.61
OCaml #4   Make Error  
OCaml #3   Make Error  
OCaml #2   Make Error  
binary-trees
source mem gz cpu
OCaml #5 154,648 461 8.80
OCaml #2 135,536 751 10.65
F# .NET #7 1,398,648 516 15.62
OCaml

OCaml native-code
version 4.14.0

F# .NET

.NET SDK 6.0.101
Host Version: 6.0.1;
Commit: 3a25a7f1cc
<ServerGarbageCollection>true