Perl VS C# benchmarks

Current benchmark data was generated on Sun Jun 01 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 901ms 14ms 197.1MB 893ms 147ms dotnet 9.0.300
csharp 1.cs 1061ms 140ms 164.4MB 963ms 127ms dotnet/aot 9.0.300
csharp 1.cs 1725ms 105ms 103.6MB 1900ms 227ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4960ms 27ms perl 5.40.2

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 141ms 1.3ms 46.1MB 120ms 10ms mono 6.12.0
csharp 1.cs 175ms 44ms 31.8MB 100ms 33ms dotnet/aot 9.0.300
csharp 1.cs 191ms 4.8ms 49.7MB 147ms 37ms dotnet 9.0.300
perl 1.pl 1815ms 12ms 14.4MB 1800ms 0ms 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 124ms 7.2ms 23.0MB 350ms 80ms dotnet/aot 9.0.300
csharp 5-m.cs 190ms 9.8ms 39.9MB 463ms 120ms dotnet 9.0.300
csharp 5-m.cs 234ms 8.5ms 37.7MB 657ms 93ms mono 6.12.0
perl 1.pl 3556ms 18ms 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.5ms 16.0MB 30ms 10ms dotnet/aot 9.0.300
csharp 5-m.cs 63ms 2.5ms 37.0MB 83ms 17ms dotnet 9.0.300
csharp 5-m.cs 72ms 3.0ms 29.5MB 103ms 20ms mono 6.12.0
perl 1.pl 367ms 3.7ms 6.6MB 357ms 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.3ms 5.3MB 0ms 0ms perl 5.40.2
csharp 1.cs 7.8ms 2.1ms 9.5MB 0ms 0ms dotnet/aot 9.0.300
csharp 1.cs 30ms 0.5ms 21.7MB 18ms 2ms mono 6.12.0
csharp 1.cs 34ms 1.1ms 26.1MB 20ms 2ms dotnet 9.0.300

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 360ms 3.8ms 27.9MB 340ms 10ms dotnet 9.0.300
csharp 8.cs 370ms 3.3ms 9.9MB 360ms 0ms dotnet/aot 9.0.300
csharp 8.cs 419ms 1.1ms 27.6MB 400ms 3ms dotnet 9.0.300
csharp 8.cs 1252ms 4.8ms 22.3MB 1237ms 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.2ms 9.9MB 30ms 0ms dotnet/aot 9.0.300
csharp 9.cs 93ms 3.0ms 27.6MB 73ms 7ms dotnet 9.0.300
csharp 8.cs 95ms 2.3ms 27.6MB 77ms 3ms dotnet 9.0.300
csharp 8.cs 161ms 0.7ms 22.4MB 147ms 0ms mono 6.12.0
perl 2.pl 2719ms 106ms 6.1MB 2707ms 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 1881ms 41ms 10.4MB 7243ms 7ms dotnet/aot 9.0.300
csharp 3-m.cs 1938ms 34ms 29.9MB 7323ms 20ms dotnet 9.0.300
csharp 3-m.cs 4838ms 168ms 25.5MB 18427ms 13ms mono 6.12.0
perl 4.pl timeout 0.0ms 9.9MB 19830ms 0ms perl 5.40.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 475ms 1.3ms 10.5MB 1813ms 0ms dotnet/aot 9.0.300
csharp 3-m.cs 529ms 1.2ms 30.0MB 1873ms 10ms dotnet 9.0.300
csharp 3-m.cs 1200ms 10ms 26.7MB 4517ms 7ms mono 6.12.0
perl 4.pl timeout 0.0ms 10.0MB 19553ms 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.6MB 447ms 10ms dotnet/aot 9.0.300
csharp 3-m.cs 179ms 3.3ms 28.4MB 497ms 17ms dotnet 9.0.300
csharp 3-m.cs 341ms 6.9ms 25.5MB 1153ms 7ms mono 6.12.0
perl 4-m.pl 3429ms 2.4ms 9.5MB 13317ms 7ms perl 5.40.2