Perl VS C# benchmarks

Current benchmark data was generated on Mon Jun 23 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 934ms 5.4ms 205.2MB 963ms 147ms dotnet 9.0.301
csharp 1.cs 978ms 18ms 174.5MB 967ms 137ms dotnet/aot 9.0.301
csharp 1.cs 1709ms 47ms 103.2MB 1913ms 217ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4963ms 27ms perl 5.40.2

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 115ms 6.0ms 32.3MB 83ms 27ms dotnet/aot 9.0.301
csharp 1.cs 144ms 2.8ms 44.3MB 120ms 13ms mono 6.12.0
csharp 1.cs 202ms 8.2ms 50.2MB 153ms 37ms dotnet 9.0.301
perl 1.pl 1824ms 20ms 14.4MB 1807ms 3ms perl 5.40.2

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 130ms 8.6ms 26.5MB 370ms 90ms dotnet/aot 9.0.301
csharp 5-m.cs 191ms 3.5ms 38.5MB 467ms 127ms dotnet 9.0.301
csharp 5-m.cs 230ms 6.7ms 48.8MB 660ms 90ms mono 6.12.0
perl 1.pl 3560ms 16ms 10.9MB 3543ms 0ms perl 5.40.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 25ms 0.6ms 15.4MB 37ms 13ms dotnet/aot 9.0.301
csharp 5-m.cs 65ms 6.7ms 37.0MB 87ms 13ms dotnet 9.0.301
csharp 5-m.cs 71ms 1.6ms 30.0MB 97ms 27ms mono 6.12.0
perl 1.pl 367ms 3.4ms 6.6MB 353ms 0ms perl 5.40.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.6ms 0.2ms 5.1MB 0ms 0ms perl 5.40.2
csharp 1.cs 7.3ms 1.8ms 8.3MB 0ms 0ms dotnet/aot 9.0.301
csharp 1.cs 32ms 0.6ms 21.3MB 20ms 0ms mono 6.12.0
csharp 1.cs 35ms 1.3ms 26.1MB 20ms 4ms dotnet 9.0.301

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 363ms 6.1ms 27.9MB 340ms 10ms dotnet 9.0.301
csharp 8.cs 371ms 2.5ms 9.9MB 360ms 0ms dotnet/aot 9.0.301
csharp 8.cs 431ms 6.0ms 27.8MB 413ms 10ms dotnet 9.0.301
csharp 8.cs 1252ms 0.3ms 22.4MB 1240ms 0ms mono 6.12.0
perl 2.pl timeout 0.0ms 6.1MB 4990ms 0ms perl 5.40.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 8.cs 44ms 0.0ms 9.9MB 30ms 0ms dotnet/aot 9.0.301
csharp 8.cs 96ms 0.6ms 27.8MB 77ms 10ms dotnet 9.0.301
csharp 9.cs 111ms 17ms 27.9MB 87ms 7ms dotnet 9.0.301
csharp 8.cs 166ms 2.0ms 20.8MB 150ms 0ms mono 6.12.0
perl 2.pl 2829ms 163ms 6.1MB 2820ms 0ms perl 5.40.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 1888ms 32ms 10.5MB 7287ms 7ms dotnet/aot 9.0.301
csharp 3-m.cs 1932ms 11ms 30.1MB 7360ms 17ms dotnet 9.0.301
csharp 3-m.cs 4684ms 65ms 27.0MB 17910ms 10ms mono 6.12.0
perl 4.pl timeout 0.0ms 9.9MB 19817ms 10ms perl 5.40.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 477ms 1.2ms 10.1MB 1823ms 7ms dotnet/aot 9.0.301
csharp 3-m.cs 666ms 1.4ms 29.9MB 1670ms 10ms dotnet 9.0.301
csharp 3-m.cs 1209ms 1.7ms 25.9MB 4553ms 7ms mono 6.12.0
perl 4.pl timeout 0.0ms 10.1MB 19537ms 10ms perl 5.40.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 129ms 0.6ms 10.8MB 450ms 3ms dotnet/aot 9.0.301
csharp 3-m.cs 251ms 7.7ms 29.0MB 460ms 10ms dotnet 9.0.301
csharp 3-m.cs 354ms 11ms 25.4MB 1197ms 3ms mono 6.12.0
perl 4-m.pl 3441ms 7.2ms 9.5MB 13347ms 3ms perl 5.40.2