Perl VS C# benchmarks

Current benchmark data was generated on Tue Jul 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 987ms 1.3ms 197.6MB 1000ms 140ms dotnet 9.0.301
csharp 1.cs 1008ms 13ms 179.9MB 1017ms 137ms dotnet/aot 9.0.301
csharp 1.cs 1685ms 31ms 103.5MB 1857ms 217ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4957ms 30ms perl 5.40.2

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 122ms 5.7ms 36.6MB 90ms 30ms dotnet/aot 9.0.301
csharp 1.cs 142ms 0.8ms 41.9MB 120ms 13ms mono 6.12.0
csharp 1.cs 203ms 6.4ms 50.0MB 157ms 33ms dotnet 9.0.301
perl 1.pl 1815ms 1.3ms 14.3MB 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 137ms 2.4ms 25.0MB 370ms 107ms dotnet/aot 9.0.301
csharp 5-m.cs 190ms 2.4ms 39.6MB 470ms 117ms dotnet 9.0.301
csharp 5-m.cs 227ms 8.2ms 45.5MB 643ms 93ms mono 6.12.0
perl 1.pl 3595ms 23ms 10.9MB 3583ms 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.9ms 16.0MB 40ms 13ms dotnet/aot 9.0.301
csharp 5-m.cs 67ms 3.3ms 37.1MB 90ms 20ms dotnet 9.0.301
csharp 5-m.cs 71ms 2.0ms 31.3MB 100ms 23ms mono 6.12.0
perl 1.pl 367ms 5.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.7ms 0.2ms 5.1MB 0ms 0ms perl 5.40.2
csharp 1.cs 6.3ms 0.3ms 8.3MB 0ms 0ms dotnet/aot 9.0.301
csharp 1.cs 32ms 1.0ms 21.2MB 20ms 0ms mono 6.12.0
csharp 1.cs 38ms 1.2ms 26.3MB 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 365ms 5.3ms 27.6MB 343ms 10ms dotnet 9.0.301
csharp 8.cs 373ms 3.5ms 9.8MB 360ms 0ms dotnet/aot 9.0.301
csharp 8.cs 425ms 6.0ms 27.6MB 410ms 7ms dotnet 9.0.301
csharp 8.cs 1248ms 2.0ms 20.3MB 1230ms 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 46ms 1.5ms 9.9MB 30ms 0ms dotnet/aot 9.0.301
csharp 8.cs 97ms 3.2ms 27.5MB 77ms 7ms dotnet 9.0.301
csharp 9.cs 99ms 5.9ms 27.9MB 73ms 10ms dotnet 9.0.301
csharp 8.cs 168ms 3.1ms 22.4MB 153ms 0ms mono 6.12.0
perl 2.pl 2771ms 37ms 6.1MB 2760ms 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 1871ms 1.6ms 10.5MB 7320ms 3ms dotnet/aot 9.0.301
csharp 3-m.cs 1923ms 1.9ms 30.0MB 7370ms 10ms dotnet 9.0.301
csharp 3-m.cs 4682ms 158ms 27.7MB 17883ms 23ms mono 6.12.0
perl 4.pl timeout 0.0ms 9.9MB 19760ms 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 488ms 17ms 10.5MB 1800ms 0ms dotnet/aot 9.0.301
csharp 3-m.cs 632ms 70ms 29.9MB 1737ms 20ms dotnet 9.0.301
csharp 3-m.cs 1186ms 38ms 25.3MB 4467ms 7ms mono 6.12.0
perl 4.pl timeout 0.0ms 10.1MB 19560ms 7ms perl 5.40.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 136ms 11ms 10.5MB 447ms 7ms dotnet/aot 9.0.301
csharp 3-m.cs 252ms 16ms 28.8MB 463ms 13ms dotnet 9.0.301
csharp 3-m.cs 345ms 3.8ms 27.6MB 1160ms 10ms mono 6.12.0
perl 4-m.pl 3483ms 51ms 9.4MB 13397ms 0ms perl 5.40.2