The Computer Language
Benchmarks Game

C# .NET Core versus Java fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

regex-redux
source secs mem gz busy cpu load
C# .NET Core 1.43 330,072 1869 2.71 33% 39% 88% 30%
Java 5.75 647,984 929 18.61 82% 88% 77% 77%
spectral-norm
source secs mem gz busy cpu load
C# .NET Core 0.83 33,876 764 2.98 93% 89% 90% 88%
Java 1.57 39,376 756 5.94 96% 94% 95% 95%
k-nucleotide
source secs mem gz busy cpu load
C# .NET Core 3.29 182,332 2044 11.02 85% 70% 94% 86%
Java 4.57 485,000 1812 14.50 77% 74% 83% 82%
mandelbrot
source secs mem gz busy cpu load
C# .NET Core 3.19 61,264 816 12.41 97% 97% 98% 97%
Java 4.14 71,012 796 16.29 99% 99% 98% 98%
fannkuch-redux
source secs mem gz busy cpu load
C# .NET Core 8.27 30,316 1225 32.79 99% 99% 99% 99%
Java 10.61 34,960 1282 42.06 99% 99% 99% 98%
fasta
source secs mem gz busy cpu load
C# .NET Core 1.14 91,504 1691 4.21 93% 91% 90% 95%
Java 1.27 45,584 2473 3.91 82% 83% 73% 70%
binary-trees
source secs mem gz busy cpu load
C# .NET Core 2.27 677,952 753 7.57 86% 81% 85% 83%
Java 2.48 2,496,112 835 7.88 78% 91% 74% 75%
pidigits
source secs mem gz busy cpu load
C# .NET Core 0.93 34,720 973 1.11 4% 5% 95% 14%
Java 0.94 36,644 764 1.07 98% 5% 2% 9%
reverse-complement
source secs mem gz busy cpu load
C# .NET Core 1.60 1,028,352 1621 3.85 26% 43% 80% 92%
Java 1.58 677,584 2183 3.76 55% 74% 48% 61%
n-body
source secs mem gz busy cpu load
C# .NET Core 6.89 32,456 1343 7.16 1% 3% 99% 1%
Java 6.74 36,480 1489 6.84 100% 1% 0% 0%
C# .NET Core

.NET Core SDK 3.1.301
Host Version: 3.1.5; Commit: 65cd789777
<ServerGarbageCollection>true

Java

java 14.0.1 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)