Php VS C# benchmarks

Current benchmark data was generated on Tue Jul 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 987ms 1.3ms 197.6MB 1000ms 140ms dotnet 9.0.301
csharp 1.cs 1008ms 13ms 179.9MB 1017ms 137ms dotnet/aot 9.0.301
csharp 1.cs 1685ms 31ms 103.5MB 1857ms 217ms mono 6.12.0
php 1.php timeout 0.0ms 141.6MB 4963ms 20ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 122ms 5.7ms 36.6MB 90ms 30ms dotnet/aot 9.0.301
csharp 1.cs 142ms 0.8ms 41.9MB 120ms 13ms mono 6.12.0
csharp 1.cs 203ms 6.4ms 50.0MB 157ms 33ms dotnet 9.0.301
php 1.php 614ms 0.1ms 62.7MB 583ms 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 6.3ms 0.3ms 8.3MB 0ms 0ms dotnet/aot 9.0.301
csharp 1.cs 32ms 1.0ms 21.2MB 20ms 0ms mono 6.12.0
csharp 1.cs 38ms 1.2ms 26.3MB 20ms 4ms dotnet 9.0.301
php 1.php 48ms 2.3ms 52.2MB 18ms 20ms php 8.2.28

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 551ms 10ms 119.2MB 507ms 87ms dotnet/aot 9.0.301
csharp 1.cs 630ms 2.9ms 147.3MB 580ms 127ms dotnet/aot 9.0.301
csharp 2.cs 714ms 12ms 136.7MB 647ms 93ms dotnet 9.0.301
csharp 1.cs 753ms 7.5ms 167.4MB 700ms 133ms dotnet 9.0.301
csharp 1.cs 1373ms 35ms 139.5MB 1567ms 183ms mono 6.12.0
php 1.php 3860ms 168ms 113.6MB 3810ms 33ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 139ms 5.9ms 57.8MB 110ms 33ms dotnet/aot 9.0.301
csharp 1.cs 163ms 8.0ms 72.7MB 123ms 50ms dotnet/aot 9.0.301
csharp 2.cs 267ms 8.1ms 75.7MB 220ms 40ms dotnet 9.0.301
csharp 1.cs 276ms 1.5ms 89.7MB 243ms 53ms dotnet 9.0.301
csharp 1.cs 277ms 2.7ms 69.5MB 250ms 37ms mono 6.12.0
php 1.php 857ms 20ms 66.8MB 823ms 20ms php 8.2.28