Php VS C# benchmarks

Current benchmark data was generated on Thu Feb 01 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 1213ms 21ms 132.8MB 1443ms 180ms dotnet/aot 8.0.101
csharp 1.cs 1714ms 70ms 109.8MB 1903ms 220ms mono 6.12.0
csharp 1.cs 1868ms 70ms 2126.1MB 710ms 1117ms dotnet 8.0.101
php 1.php timeout 0.0ms 141.7MB 4960ms 27ms php 8.2.14

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 92ms 2.7ms 29.1MB 93ms 13ms dotnet/aot 8.0.101
csharp 1.cs 142ms 1.4ms 44.9MB 117ms 13ms mono 6.12.0
csharp 1.cs 283ms 5.7ms 229.7MB 130ms 113ms dotnet 8.0.101
php 1.php 625ms 4.3ms 63.0MB 593ms 20ms php 8.2.14

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 12ms 11ms 16.2MB 0ms 0ms dotnet/aot 8.0.101
csharp 1.cs 32ms 0.5ms 23.8MB 18ms 2ms mono 6.12.0
php 1.php 52ms 1.8ms 52.0MB 14ms 24ms php 8.2.14
csharp 1.cs 56ms 6.0ms 31.4MB 20ms 2ms dotnet 8.0.101

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 520ms 2.4ms 155.2MB 587ms 87ms dotnet/aot 8.0.101
csharp 1.cs 601ms 10ms 107.3MB 693ms 97ms dotnet/aot 8.0.101
csharp 2.cs 1201ms 5.0ms 1295.1MB 493ms 673ms dotnet 8.0.101
csharp 1.cs 1308ms 29ms 144.8MB 1517ms 157ms mono 6.12.0
csharp 1.cs 1565ms 4.3ms 1869.6MB 580ms 943ms dotnet 8.0.101
php 1.php 4001ms 93ms 113.7MB 3957ms 27ms php 8.2.14

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 110ms 2.0ms 38.0MB 113ms 17ms dotnet/aot 8.0.101
csharp 1.cs 123ms 1.1ms 48.4MB 130ms 23ms dotnet/aot 8.0.101
csharp 1.cs 262ms 7.9ms 73.9MB 237ms 33ms mono 6.12.0
csharp 2.cs 371ms 4.9ms 305.1MB 183ms 157ms dotnet 8.0.101
csharp 1.cs 441ms 8.6ms 428.5MB 170ms 237ms dotnet 8.0.101
php 1.php 830ms 5.3ms 66.9MB 793ms 20ms php 8.2.14