The Computer Language
Benchmarks Game

C# .NET versus C++ g++ 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.

spectral-norm
source secs mem gz busy cpu load
C# .NET 0.82 35,048 764 2.99 89% 96% 89% 89%
C++ g++ 0.72 1,192 1044 2.85 99% 99% 100% 100%
regex-redux
source secs mem gz busy cpu load
C# .NET 1.42 280,892 1869 2.69 30% 39% 86% 35%
C++ g++ 1.10 203,924 1315 3.43 63% 77% 71% 100%
pidigits
source secs mem gz busy cpu load
C# .NET 0.92 35,404 977 0.96 98% 3% 2% 1%
C++ g++ 0.66 5,152 986 2.63 100% 100% 100% 100%
fasta
source secs mem gz busy cpu load
C# .NET 1.21 152,684 1691 4.58 96% 97% 92% 93%
C++ g++ 0.77 2,504 2751 1.52 64% 0% 99% 37%
k-nucleotide
source secs mem gz busy cpu load
C# .NET 3.29 182,860 2044 11.20 99% 86% 66% 90%
C++ g++ 1.93 156,548 1631 5.88 69% 93% 69% 75%
n-body
source secs mem gz busy cpu load
C# .NET 4.83 32,756 1704 4.85 0% 0% 0% 100%
C++ g++ 2.12 764 1927 2.17 0% 2% 100% 0%
fannkuch-redux
source secs mem gz busy cpu load
C# .NET 8.40 30,848 1225 33.29 99% 100% 99% 99%
C++ g++ 3.29 1,892 1528 13.06 100% 100% 100% 97%
reverse-complement
source secs mem gz busy cpu load
C# .NET 1.50 950,648 1310 4.29 93% 63% 93% 38%
C++ g++ 0.52 1,788 1853 0.52 0% 98% 0% 2%
mandelbrot
source secs mem gz busy cpu load
C# .NET 3.14 64,940 1974 12.30 99% 98% 97% 97%
C++ g++ 0.84 34,780 3542 3.27 99% 98% 98% 96%
binary-trees
source secs mem gz busy cpu load
C# .NET 4.81 1,881,564 676 15.47 81% 74% 83% 83%
C++ g++ 0.94 176,428 1122 3.39 86% 88% 100% 85%
C# .NET

.NET SDK 5.0.201
Host Version: 5.0.4; Commit: f27d337295
<ServerGarbageCollection>true</ServerGarbageCollection>

C++ g++

g++ (Ubuntu 10.3.0-1ubuntu1) 10.3.0