The Computer Language
22.01 Benchmarks Game

C# .NET versus C++ g++ fastest programs

Always look at the source code. These are only the fastest programs.

If they are manually vectorized SIMD, does the host language matter? You might not be interested in the most optimised programs.

Look at "mandelbrot" or "spectral-norm" or other measurement tables. Look at the other programs. Choose which programs you want to compare.

spectral-norm
source secs mem gz busy cpu load
C# .NET 0.82 34,824 764 3.00 96% 90% 90% 91%
C++ g++ 0.72 1,296 1044 2.86 99% 100% 100% 99%
regex-redux
source secs mem gz busy cpu load
C# .NET 1.39 318,212 1869 2.63 50% 21% 88% 30%
C++ g++ 1.11 203,844 1315 3.43 76% 63% 100% 71%
pidigits
source secs mem gz busy cpu load
C# .NET 0.79 33,196 1168 0.81 98% 4% 0% 1%
C++ g++ 0.59 5,024 986 2.36 98% 100% 100% 100%
n-body
source secs mem gz busy cpu load
C# .NET 3.18 32,632 2467 3.23 2% 99% 0% 1%
C++ g++ 2.17 992 1927 2.23 1% 0% 100% 1%
fasta
source secs mem gz busy cpu load
C# .NET 1.22 108,212 1691 4.45 93% 92% 91% 89%
C++ g++ 0.77 2,676 2751 1.59 99% 38% 66% 4%
k-nucleotide
source secs mem gz busy cpu load
C# .NET 3.21 184,240 2044 11.03 95% 89% 89% 70%
C++ g++ 1.96 156,492 1631 5.97 69% 98% 68% 69%
reverse-complement
source secs mem gz busy cpu load
C# .NET 1.58 1,029,116 1621 3.88 30% 94% 66% 54%
C++ g++ 0.64 499,692 2093 0.64 0% 0% 0% 100%
fannkuch-redux
source secs mem gz busy cpu load
C# .NET 8.74 31,712 1225 34.71 99% 99% 100% 99%
C++ g++ 3.26 1,992 1528 12.94 98% 100% 100% 100%
mandelbrot
source secs mem gz busy cpu load
C# .NET 3.11 65,960 816 12.18 97% 99% 98% 97%
C++ g++ 0.84 34,800 3542 3.28 98% 99% 98% 98%
binary-trees
source secs mem gz busy cpu load
C# .NET 4.90 1,651,992 705 15.90 77% 79% 79% 89%
C++ g++ 0.94 176,440 890 3.33 85% 87% 83% 100%
C# .NET

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

C++ g++

g++ (Ubuntu 11.2.0-7ubuntu2) 11.2.0