Php VS C# benchmarks

Current benchmark data was generated on Thu Jul 13 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 1238ms 15ms 384.0MB 1173ms 167ms dotnet/aot 7.0.306
csharp 1.cs 1474ms 24ms 397.6MB 1343ms 190ms dotnet 7.0.306
csharp 1.cs 2201ms 41ms 104.3MB 2517ms 157ms mono 6.12.0
php 1.php timeout 0.0ms 141.1MB 4960ms 13ms php 8.2.8

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 126ms 4.3ms 72.0MB 100ms 23ms dotnet/aot 7.0.306
csharp 1.cs 153ms 0.8ms 44.0MB 137ms 3ms mono 6.12.0
csharp 1.cs 237ms 4.4ms 95.5MB 180ms 33ms dotnet 7.0.306
php 1.php 798ms 1.5ms 62.3MB 767ms 17ms php 8.2.8

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 6.8ms 0.8ms 12.1MB 0ms 0ms dotnet/aot 7.0.306
csharp 1.cs 19ms 0.6ms 25.6MB 10ms 0ms mono 6.12.0
php 1.php 46ms 1.9ms 51.3MB 24ms 8ms php 8.2.8
csharp 1.cs 59ms 1.9ms 28.8MB 26ms 2ms dotnet 7.0.306

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 804ms 26ms 369.6MB 673ms 170ms dotnet/aot 7.0.306
csharp 1.cs 841ms 7.8ms 384.6MB 710ms 183ms dotnet/aot 7.0.306
csharp 2.cs 1026ms 11ms 413.9MB 847ms 167ms dotnet 7.0.306
csharp 1.cs 1047ms 13ms 441.4MB 860ms 210ms dotnet 7.0.306
csharp 1.cs 1681ms 23ms 145.1MB 2023ms 143ms mono 6.12.0
php 1.php 4890ms 59ms 113.4MB 4853ms 20ms php 8.2.8

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 2.cs 158ms 3.1ms 77.3MB 133ms 20ms dotnet/aot 7.0.306
csharp 1.cs 229ms 11ms 197.7MB 147ms 77ms dotnet/aot 7.0.306
csharp 1.cs 309ms 7.0ms 72.1MB 280ms 37ms mono 6.12.0
csharp 1.cs 346ms 2.7ms 200.9MB 237ms 90ms dotnet 7.0.306
csharp 2.cs 369ms 0.4ms 101.9MB 313ms 37ms dotnet 7.0.306
php 1.php 1078ms 10ms 66.6MB 1053ms 10ms php 8.2.8