How fast is C#?
We timed 12 programs on the same computer: the original C# code, our faster C# version and 10 other languages. Each one runs the same 90 tests on 9 data structures.
- C# new, overall time
- …
- Place out of 12
- …
- Faster than the original
- …
Loading the results…
Ranking
Overall time for each program. Each ball crosses its lane in the program's time, scaled so the fastest takes 1 second. Below, the same times as numbers: a lower time is better, and a longer bar is faster.
By data structure
1.00 is the fastest program for that data structure. 1.50 means it took 1.5 times as long. Click a name to see its tests.
Tests
Time for each test. Each dot is one program, and further left is faster.
Show these times as a table
What we changed in C#
Each change is a small patch to the original code. The tests, and the results they check, stay the same.
How we tested
Run it yourself
You need Python 3.10 or newer, the .NET 11 SDK and the compilers in the table below. Change 6 to a CPU core your computer has.
taskset -c 6 python3 bench.py --native-aot \
--full-references --interleave \
--quiet-gate 6 --repetitions 1 \
--output run.json
python3 tools/make_results.py run.json