Perl VS C# benchmarks

Current benchmark data was generated on Wed Jan 22 2025, 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 912ms 14ms 187.1MB 903ms 140ms dotnet/aot 9.0.102
csharp 1.cs 964ms 9.3ms 206.6MB 947ms 153ms dotnet 9.0.102
csharp 1.cs 1752ms 85ms 103.6MB 1933ms 253ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4960ms 27ms perl 5.40.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 117ms 2.5ms 41.9MB 80ms 30ms dotnet/aot 9.0.102
csharp 1.cs 151ms 2.8ms 46.3MB 127ms 10ms mono 6.12.0
csharp 1.cs 204ms 17ms 64.6MB 153ms 37ms dotnet 9.0.102
perl 1.pl 1798ms 12ms 14.4MB 1787ms 0ms perl 5.40.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 138ms 5.4ms 33.9MB 347ms 123ms dotnet/aot 9.0.102
csharp 5-m.cs 188ms 2.6ms 50.8MB 470ms 113ms dotnet 9.0.102
csharp 5-m.cs 259ms 14ms 58.4MB 653ms 157ms mono 6.12.0
perl 1.pl 3604ms 17ms 10.9MB 3590ms 0ms perl 5.40.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 26ms 1.6ms 23.7MB 33ms 17ms dotnet/aot 9.0.102
csharp 5-m.cs 61ms 1.5ms 47.1MB 83ms 20ms dotnet 9.0.102
csharp 5-m.cs 70ms 1.0ms 39.6MB 103ms 17ms mono 6.12.0
perl 1.pl 383ms 27ms 6.5MB 367ms 0ms perl 5.40.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.8ms 0.4ms 5.1MB 0ms 0ms perl 5.40.1
csharp 1.cs 18ms 10ms 12.5MB 0ms 0ms dotnet/aot 9.0.102
csharp 1.cs 31ms 0.2ms 23.3MB 22ms 0ms mono 6.12.0
csharp 1.cs 35ms 0.3ms 30.3MB 16ms 4ms dotnet 9.0.102

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 360ms 2.4ms 34.2MB 340ms 10ms dotnet 9.0.102
csharp 8.cs 370ms 0.4ms 15.7MB 357ms 0ms dotnet/aot 9.0.102
csharp 8.cs 418ms 0.9ms 33.8MB 393ms 10ms dotnet 9.0.102
csharp 8.cs 1246ms 5.3ms 22.4MB 1230ms 0ms mono 6.12.0
perl 2.pl timeout 0.0ms 6.1MB 4987ms 0ms perl 5.40.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 46ms 1.7ms 16.0MB 30ms 0ms dotnet/aot 9.0.102
csharp 9.cs 92ms 1.1ms 34.0MB 77ms 0ms dotnet 9.0.102
csharp 8.cs 105ms 9.8ms 34.0MB 73ms 10ms dotnet 9.0.102
csharp 8.cs 162ms 2.1ms 26.3MB 147ms 3ms mono 6.12.0
perl 2.pl 2757ms 41ms 6.1MB 2743ms 0ms perl 5.40.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 1873ms 37ms 18.4MB 7180ms 7ms dotnet/aot 9.0.102
csharp 3-m.cs 1971ms 75ms 38.1MB 7220ms 13ms dotnet 9.0.102
csharp 3-m.cs 4634ms 249ms 30.7MB 17543ms 10ms mono 6.12.0
perl 4.pl timeout 0.0ms 13.8MB 19717ms 23ms perl 5.40.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 476ms 1.6ms 18.2MB 1790ms 10ms dotnet/aot 9.0.102
csharp 3-m.cs 542ms 12ms 39.9MB 1870ms 10ms dotnet 9.0.102
csharp 3-m.cs 1203ms 18ms 31.0MB 4483ms 7ms mono 6.12.0
perl 4.pl timeout 0.0ms 14.0MB 19480ms 10ms perl 5.40.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 129ms 1.0ms 18.4MB 440ms 7ms dotnet/aot 9.0.102
csharp 3-m.cs 193ms 15ms 36.4MB 497ms 10ms dotnet 9.0.102
csharp 3-m.cs 348ms 2.4ms 26.4MB 1160ms 7ms mono 6.12.0
perl 4-m.pl 3392ms 3.3ms 12.4MB 13083ms 10ms perl 5.40.1