The Computer Language
Benchmarks Game

F# .NET versus Java 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%
Java 5.58 985,696 929 18.26 81% 77% 84% 85%
k-nucleotide
source secs mem gz busy cpu load
F# .NET 3.65 184,680 1907 12.58 94% 84% 85% 83%
Java 4.98 356,904 1812 16.25 78% 76% 96% 76%
n-body
source secs mem gz busy cpu load
F# .NET 5.07 35,072 1383 5.18 1% 99% 1% 1%
Java 6.74 35,844 1489 6.82 1% 100% 1% 0%
fannkuch-redux
source secs mem gz busy cpu load
F# .NET 8.65 31,784 1097 33.57 98% 99% 94% 98%
Java 10.64 35,192 1282 41.91 99% 98% 99% 97%
pidigits
source secs mem gz busy cpu load
F# .NET 0.82 34,428 905 0.83 1% 2% 96% 1%
Java 0.93 36,552 764 0.98 2% 3% 1% 99%
mandelbrot
source secs mem gz busy cpu load
F# .NET 3.77 64,912 933 14.73 99% 97% 98% 97%
Java 4.15 69,136 796 16.29 98% 99% 98% 99%
fasta
source secs mem gz busy cpu load
F# .NET 1.14 120,528 1350 4.18 94% 94% 89% 91%
Java 1.21 44,620 2543 3.58 89% 75% 65% 68%
spectral-norm
source secs mem gz busy cpu load
F# .NET 1.55 31,916 853 5.83 92% 98% 93% 93%
Java 1.63 39,304 756 6.22 95% 97% 95% 95%
reverse-complement
source secs mem gz busy cpu load
F# .NET 1.51 1,030,852 1140 4.19 93% 36% 58% 91%
Java 1.54 670,924 2183 3.51 46% 56% 48% 79%
binary-trees
source secs mem gz busy cpu load
F# .NET 6.06 1,469,616 516 16.18 63% 69% 62% 72%
Java 2.48 1,722,848 835 7.88 98% 75% 71% 74%
F# .NET

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

Java

openjdk 16 2021-03-16
OpenJDK Runtime Environment (build 16+36-2231)
OpenJDK 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)