Php VS C# benchmarks

Current benchmark data was generated on Wed Jan 22 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 912ms 14ms 187.1MB 903ms 140ms dotnet/aot 9.0.102
csharp 1.cs 964ms 9.3ms 206.6MB 947ms 153ms dotnet 9.0.102
csharp 1.cs 1752ms 85ms 103.6MB 1933ms 253ms mono 6.12.0
php 1.php timeout 0.0ms 141.9MB 4957ms 23ms php 8.2.27

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 117ms 2.5ms 41.9MB 80ms 30ms dotnet/aot 9.0.102
csharp 1.cs 151ms 2.8ms 46.3MB 127ms 10ms mono 6.12.0
csharp 1.cs 204ms 17ms 64.6MB 153ms 37ms dotnet 9.0.102
php 1.php 619ms 7.3ms 62.7MB 590ms 13ms php 8.2.27

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 18ms 10ms 12.5MB 0ms 0ms dotnet/aot 9.0.102
csharp 1.cs 31ms 0.2ms 23.3MB 22ms 0ms mono 6.12.0
csharp 1.cs 35ms 0.3ms 30.3MB 16ms 4ms dotnet 9.0.102
php 1.php 50ms 1.1ms 52.6MB 22ms 12ms php 8.2.27

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 540ms 17ms 126.2MB 480ms 90ms dotnet/aot 9.0.102
csharp 1.cs 585ms 1.6ms 153.7MB 523ms 133ms dotnet/aot 9.0.102
csharp 2.cs 687ms 11ms 142.9MB 637ms 97ms dotnet 9.0.102
csharp 1.cs 740ms 30ms 169.4MB 690ms 120ms dotnet 9.0.102
csharp 1.cs 1320ms 56ms 146.4MB 1527ms 183ms mono 6.12.0
php 1.php 3744ms 64ms 113.9MB 3703ms 23ms php 8.2.27

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 135ms 1.9ms 64.0MB 103ms 33ms dotnet/aot 9.0.102
csharp 1.cs 153ms 2.5ms 80.5MB 120ms 43ms dotnet/aot 9.0.102
csharp 1.cs 260ms 7.3ms 69.5MB 233ms 33ms mono 6.12.0
csharp 2.cs 263ms 7.3ms 82.8MB 210ms 47ms dotnet 9.0.102
csharp 1.cs 288ms 18ms 99.0MB 240ms 50ms dotnet 9.0.102
php 1.php 826ms 9.2ms 67.1MB 787ms 23ms php 8.2.27