Php VS C# benchmarks

Current benchmark data was generated on Mon Apr 14 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 959ms 8.6ms 205.9MB 957ms 147ms dotnet 9.0.203
csharp 1.cs 974ms 8.9ms 178.1MB 980ms 130ms dotnet/aot 9.0.203
csharp 1.cs 1663ms 23ms 105.5MB 1877ms 200ms mono 6.12.0
php 1.php timeout 0.0ms 141.9MB 4957ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 122ms 4.1ms 33.2MB 90ms 30ms dotnet/aot 9.0.203
csharp 1.cs 143ms 1.7ms 42.2MB 120ms 13ms mono 6.12.0
csharp 1.cs 195ms 2.0ms 49.9MB 157ms 40ms dotnet 9.0.203
php 1.php 625ms 5.0ms 63.0MB 593ms 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 9.0ms 3.9ms 6.8MB 0ms 0ms dotnet/aot 9.0.203
csharp 1.cs 31ms 0.6ms 21.3MB 20ms 0ms mono 6.12.0
csharp 1.cs 35ms 1.3ms 26.1MB 20ms 2ms dotnet 9.0.203
php 1.php 50ms 1.2ms 52.5MB 18ms 22ms php 8.2.28

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 540ms 13ms 119.9MB 497ms 83ms dotnet/aot 9.0.203
csharp 1.cs 601ms 11ms 145.0MB 553ms 110ms dotnet/aot 9.0.203
csharp 2.cs 682ms 13ms 136.3MB 630ms 93ms dotnet 9.0.203
csharp 1.cs 702ms 20ms 168.5MB 643ms 127ms dotnet 9.0.203
csharp 1.cs 1284ms 31ms 144.0MB 1490ms 167ms mono 6.12.0
php 1.php 4002ms 68ms 114.0MB 3960ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 132ms 3.0ms 57.9MB 107ms 30ms dotnet/aot 9.0.203
csharp 1.cs 155ms 2.9ms 73.8MB 123ms 50ms dotnet/aot 9.0.203
csharp 2.cs 264ms 3.0ms 73.1MB 230ms 37ms dotnet 9.0.203
csharp 1.cs 267ms 2.8ms 69.3MB 240ms 33ms mono 6.12.0
csharp 1.cs 277ms 3.0ms 89.8MB 247ms 53ms dotnet 9.0.203
php 1.php 851ms 7.8ms 67.1MB 820ms 20ms php 8.2.28