The Computer Language
22.05 Benchmarks Game

Fastest cpu secs Java versus C# .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
C# .NET #8 33,148 1473 8.28
C# .NET #9 32,836 1225 34.63
C# .NET #6 32,152 1068 39.27
Java #3 35,324 1257 41.17
Java 35,824 1282 41.74
Java #2 34,244 514 44.98
C# .NET #7   Bad Output  
n-body
source mem gz cpu
C# .NET #9 33,528 2467 3.17
C# .NET #4 33,456 2125 3.83
C# .NET #7 33,644 1704 4.78
C# .NET #6 33,932 1742 4.80
Java #5 34,252 1429 6.79
Java #4 34,076 1489 6.79
C# .NET #3 34,000 1305 6.90
C# .NET #2 33,984 1343 7.03
C# .NET #8 33,996 1332 7.03
Java #3 34,612 1430 7.50
Java #2 34,704 1424 7.50
Java 37,380 1430 7.83
spectral-norm
source mem gz cpu
C# .NET #5 35,524 764 2.97
C# .NET #3 33,368 878 5.78
Java #3 38,428 756 5.94
Java 37,288 514 9.76
Java #2 37,368 950 10.07
mandelbrot
source mem gz cpu
C# .NET 66,656 1974 12.16
C# .NET #9 66,528 816 12.17
C# .NET #5 64,376 839 16.15
Java #4 66,304 660 16.16
Java #2 68,860 796 16.21
Java #6 67,432 802 16.92
Java 34,252 665 27.75
Java #3 69,200 903 29.18
pidigits
source mem gz cpu
C# .NET #6 33,768 1168 0.78
Java #3 35,700 764 0.82
C# .NET #5 35,888 977 0.83
C# .NET #4 32,828 1121 1.27
Java #2 38,328 938 1.53
C# .NET #7 53,276 567 8.41
Java 513,728 800 8.94
regex-redux
source mem gz cpu
C# .NET #8 319,484 1869 2.65
C# .NET #5 1,061,452 673 7.45
Java 924,116 868 17.12
Java #6 728,332 740 17.16
Java #3 741,028 929 17.34
fasta
source mem gz cpu
Java #4 36,800 1524 3.41
Java #6 42,416 2543 3.52
Java #5 42,532 2473 4.14
C# .NET #5 85,788 1691 4.43
Java #2 36,812 1257 4.46
C# .NET 51,376 2098 5.16
k-nucleotide
source mem gz cpu
C# .NET 185,200 2044 10.97
C# .NET #6 180,876 1603 15.87
Java 349,544 1812 16.17
Java #6 343,684 1607 25.67
Java #3 344,652 1635 25.73
Java #4 199,824 1882 37.48
Java #5 210,368 2219 43.27
reverse-complement
source mem gz cpu
C# .NET #8 930,564 2637 1.25
Java #8 665,804 2183 3.49
C# .NET #6 1,029,352 1621 3.79
C# .NET #5 1,032,176 1613 4.02
Java #6 2,024,016 752 4.15
Java #5 1,088,392 1108 4.92
Java #3 1,170,232 1722 5.09
C# .NET #7 979,712 1310 5.13
Java #4 1,881,900 651 5.41
Java #7 1,030,892 1647 23.16
binary-trees
source mem gz cpu
Java #3 2,106,820 540 5.19
Java #6 2,093,916 529 5.35
Java #4 2,079,388 840 5.44
Java #2 1,877,464 552 5.45
Java #7 2,460,388 835 7.73
C# .NET #7 1,609,712 694 15.29
C# .NET #3 1,964,552 676 15.35
C# .NET #2 1,475,276 705 15.77
C# .NET 1,691,664 657 16.14
Java

openjdk 18 2022-03-22
OpenJDK Runtime Environment
(build 18+36-2087)
OpenJDK 64-Bit Server VM
(build 18+36-2087,
mixed mode, sharing)

C# .NET

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