Php VS C# benchmarks

Current benchmark data was generated on Sun Jan 29 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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 1241ms 50ms 383.8MB 1153ms 187ms dotnet/aot 7.0.102
csharp 1.cs 1523ms 25ms 473.5MB 1337ms 230ms dotnet 7.0.102
csharp 1.cs 2191ms 3.7ms 98.5MB 2523ms 157ms mono 6.12.0
php 1.php timeout 0.0ms 141.0MB 4947ms 33ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 125ms 1.7ms 72.0MB 103ms 20ms dotnet/aot 7.0.102
csharp 1.cs 154ms 0.5ms 48.1MB 133ms 13ms mono 6.12.0
csharp 1.cs 255ms 5.7ms 168.2MB 180ms 53ms dotnet 7.0.102
php 1.php 787ms 4.5ms 62.3MB 757ms 10ms php 8.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 5.7ms 0.6ms 10.1MB 0ms 0ms dotnet/aot 7.0.102
csharp 1.cs 19ms 0.7ms 23.6MB 10ms 0ms mono 6.12.0
php 1.php 47ms 1.6ms 50.8MB 22ms 12ms php 8.2.1
csharp 1.cs 75ms 3.4ms 101.5MB 20ms 20ms dotnet 7.0.102

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 786ms 7.0ms 362.7MB 683ms 147ms dotnet/aot 7.0.102
csharp 1.cs 842ms 1.2ms 379.9MB 727ms 163ms dotnet/aot 7.0.102
csharp 2.cs 1019ms 3.2ms 468.0MB 840ms 190ms dotnet 7.0.102
csharp 1.cs 1066ms 8.0ms 510.7MB 857ms 230ms dotnet 7.0.102
csharp 1.cs 1697ms 30ms 143.8MB 1993ms 157ms mono 6.12.0
php 1.php 4872ms 54ms 113.2MB 4823ms 30ms php 8.2.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 159ms 1.9ms 70.7MB 127ms 30ms dotnet/aot 7.0.102
csharp 1.cs 224ms 9.9ms 199.5MB 147ms 70ms dotnet/aot 7.0.102
csharp 1.cs 305ms 1.9ms 74.1MB 280ms 30ms mono 6.12.0
csharp 1.cs 366ms 4.2ms 270.8MB 250ms 93ms dotnet 7.0.102
csharp 2.cs 389ms 1.3ms 172.5MB 333ms 43ms dotnet 7.0.102
php 1.php 1068ms 6.3ms 66.3MB 1037ms 17ms php 8.2.1