Perl 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
perl 1.pl timeout 0.0ms 77.8MB 4957ms 27ms perl 5.38.2

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
perl 1.pl 1805ms 29ms 14.1MB 1787ms 3ms perl 5.38.2

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 133ms 7.9ms 36.2MB 380ms 83ms dotnet/aot 8.0.101
csharp 5-m.cs 205ms 9.6ms 45.3MB 477ms 117ms dotnet 8.0.101
csharp 5-m.cs 262ms 5.6ms 47.9MB 683ms 147ms mono 6.12.0
perl 1.pl 3533ms 37ms 11.0MB 3517ms 0ms perl 5.38.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 34ms 1.8ms 27.0MB 50ms 27ms dotnet/aot 8.0.101
csharp 5-m.cs 85ms 10ms 42.7MB 110ms 30ms mono 6.12.0
csharp 5.cs 86ms 6.4ms 42.0MB 83ms 20ms dotnet 8.0.101
perl 1.pl 366ms 12ms 6.6MB 353ms 0ms perl 5.38.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.7ms 0.2ms 5.3MB 0ms 0ms perl 5.38.2
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
csharp 1.cs 56ms 6.0ms 31.4MB 20ms 2ms dotnet 8.0.101

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 375ms 1.6ms 14.2MB 370ms 3ms dotnet/aot 8.0.101
csharp 9.cs 383ms 7.2ms 33.1MB 343ms 10ms dotnet 8.0.101
csharp 8.cs 433ms 3.3ms 32.9MB 393ms 7ms dotnet 8.0.101
csharp 8.cs 1248ms 6.8ms 24.9MB 1230ms 3ms mono 6.12.0
perl 2.pl timeout 0.0ms 6.3MB 4990ms 0ms perl 5.38.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 48ms 1.3ms 16.1MB 43ms 3ms dotnet/aot 8.0.101
csharp 8.cs 106ms 7.9ms 33.2MB 67ms 10ms dotnet 8.0.101
csharp 9.cs 114ms 2.8ms 33.1MB 77ms 10ms dotnet 8.0.101
csharp 8.cs 162ms 1.0ms 27.0MB 150ms 0ms mono 6.12.0
perl 2.pl 2562ms 54ms 6.3MB 2553ms 0ms perl 5.38.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 1868ms 28ms 18.9MB 7187ms 17ms dotnet/aot 8.0.101
csharp 3-m.cs 2016ms 168ms 39.0MB 7077ms 27ms dotnet 8.0.101
csharp 3-m.cs 4685ms 117ms 29.1MB 17887ms 20ms mono 6.12.0
perl 4.pl timeout 0.0ms 13.8MB 19783ms 10ms perl 5.38.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 477ms 2.0ms 18.7MB 1807ms 10ms dotnet/aot 8.0.101
csharp 3-m.cs 536ms 3.2ms 36.9MB 1843ms 17ms dotnet 8.0.101
csharp 3-m.cs 1178ms 36ms 29.3MB 4430ms 7ms mono 6.12.0
perl 4.pl timeout 0.0ms 14.0MB 19403ms 13ms perl 5.38.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 132ms 0.4ms 18.9MB 453ms 3ms dotnet/aot 8.0.101
csharp 3-m.cs 191ms 6.2ms 35.6MB 490ms 10ms dotnet 8.0.101
csharp 3-m.cs 344ms 4.8ms 33.1MB 1147ms 17ms mono 6.12.0
perl 4-m.pl 3241ms 7.1ms 13.5MB 12600ms 10ms perl 5.38.2