BurstBenchmarks
I was curious how well Burst/IL2CPP optimizes C# code against GCC/Clang with C, so I've ported five famous benchmarks, plus a raytracer, a minified flocking simulation, particle kinematics, a stream cipher, a hashing algorithm, and radix sort, with different workloads and made them identical between the two languages. C code compiled with all possible optimizations using -DNDEBUG -Ofast -march=native -flto
compiler options. Benchmarks were done on Windows 10 w/ Ryzen 5 1400 using standalone build. Mono JIT and RyuJIT are included for fun.
The logic acquires one core of the CPU from startup to the end. Do not perform any actions while the benchmarks are running and wait until the process is complete.
This project is donated to Unity's Burst compiler team as a performance test-suite to identify inconsistencies in the generated machine code in comparison to other compilers.
Burst 1.2.3
GCC 9.2.0
Clang (LLVM 9.0.1)
IL2CPP and Mono JIT (Unity 2019.3.2f1)
RyuJIT (.NET Core 3.1.101)
Integer math
Single-precision math
Double-precision math
Discussion
You can find the discussion in the thread on Unity forums.
Supporters
These wonderful people make open-source better:
This project is sponsored by JetBrains.