Php VS C# benchmarks

Current benchmark data was generated on Sat Nov 16 2024, 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 942ms 23ms 178.5MB 930ms 140ms dotnet/aot 9.0.100
csharp 1.cs 1121ms 32ms 206.4MB 1067ms 147ms dotnet 9.0.100
csharp 1.cs 1708ms 66ms 101.6MB 1907ms 207ms mono 6.12.0
php 1.php timeout 0.0ms 142.1MB 4957ms 23ms php 8.2.25

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 122ms 3.4ms 41.6MB 83ms 27ms dotnet/aot 9.0.100
csharp 1.cs 143ms 1.2ms 46.1MB 117ms 17ms mono 6.12.0
csharp 1.cs 196ms 4.9ms 59.9MB 153ms 33ms dotnet 9.0.100
php 1.php 629ms 22ms 62.9MB 593ms 17ms php 8.2.25

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 9.1ms 5.6ms 15.6MB 0ms 0ms dotnet/aot 9.0.100
csharp 1.cs 31ms 0.9ms 23.4MB 20ms 0ms mono 6.12.0
csharp 1.cs 35ms 0.6ms 32.3MB 20ms 6ms dotnet 9.0.100
php 1.php 50ms 1.7ms 52.6MB 20ms 18ms php 8.2.25

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 543ms 7.0ms 124.9MB 480ms 93ms dotnet/aot 9.0.100
csharp 1.cs 598ms 27ms 152.8MB 520ms 123ms dotnet/aot 9.0.100
csharp 2.cs 679ms 13ms 140.7MB 630ms 100ms dotnet 9.0.100
csharp 1.cs 754ms 16ms 173.0MB 683ms 140ms dotnet 9.0.100
csharp 1.cs 1318ms 93ms 142.6MB 1553ms 177ms mono 6.12.0
php 1.php 3826ms 86ms 113.9MB 3780ms 30ms php 8.2.25

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 135ms 1.1ms 66.2MB 107ms 30ms dotnet/aot 9.0.100
csharp 1.cs 149ms 4.0ms 80.6MB 110ms 47ms dotnet/aot 9.0.100
csharp 2.cs 256ms 2.6ms 84.5MB 213ms 53ms dotnet 9.0.100
csharp 1.cs 264ms 7.8ms 69.4MB 230ms 40ms mono 6.12.0
csharp 1.cs 274ms 1.4ms 99.3MB 243ms 57ms dotnet 9.0.100
php 1.php 832ms 8.5ms 67.2MB 797ms 17ms php 8.2.25