Php VS C# benchmarks

Current benchmark data was generated on Thu May 01 2025, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 943ms 22ms 185.3MB 937ms 150ms dotnet 9.0.203
csharp 1.cs 955ms 17ms 188.9MB 957ms 143ms dotnet/aot 9.0.203
csharp 1.cs 1699ms 20ms 101.5MB 1897ms 217ms mono 6.12.0
php 1.php timeout 0.0ms 141.6MB 4963ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 123ms 5.1ms 31.9MB 87ms 33ms dotnet/aot 9.0.203
csharp 1.cs 140ms 0.7ms 44.1MB 117ms 13ms mono 6.12.0
csharp 1.cs 206ms 6.4ms 50.4MB 157ms 37ms dotnet 9.0.203
php 1.php 617ms 9.1ms 62.4MB 587ms 17ms php 8.2.28

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 10ms 5.6ms 7.6MB 0ms 0ms dotnet/aot 9.0.203
csharp 1.cs 31ms 1.0ms 21.4MB 20ms 0ms mono 6.12.0
csharp 1.cs 34ms 0.4ms 26.0MB 20ms 2ms dotnet 9.0.203
php 1.php 46ms 1.2ms 52.2MB 16ms 18ms php 8.2.28

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 542ms 21ms 121.4MB 490ms 90ms dotnet/aot 9.0.203
csharp 1.cs 603ms 8.7ms 143.3MB 557ms 117ms dotnet/aot 9.0.203
csharp 2.cs 678ms 16ms 136.3MB 627ms 100ms dotnet 9.0.203
csharp 1.cs 761ms 17ms 164.3MB 697ms 130ms dotnet 9.0.203
csharp 1.cs 1306ms 19ms 140.5MB 1507ms 173ms mono 6.12.0
php 1.php 3693ms 23ms 113.8MB 3653ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 135ms 2.4ms 57.2MB 110ms 30ms dotnet/aot 9.0.203
csharp 1.cs 157ms 2.1ms 74.5MB 120ms 53ms dotnet/aot 9.0.203
csharp 2.cs 258ms 7.0ms 74.8MB 223ms 40ms dotnet 9.0.203
csharp 1.cs 258ms 0.7ms 69.4MB 233ms 30ms mono 6.12.0
csharp 1.cs 281ms 5.4ms 89.5MB 237ms 57ms dotnet 9.0.203
php 1.php 826ms 1.9ms 66.9MB 790ms 23ms php 8.2.28