Perl VS C# benchmarks

Current benchmark data was generated on Mon Apr 14 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 959ms 8.6ms 205.9MB 957ms 147ms dotnet 9.0.203
csharp 1.cs 974ms 8.9ms 178.1MB 980ms 130ms dotnet/aot 9.0.203
csharp 1.cs 1663ms 23ms 105.5MB 1877ms 200ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4957ms 30ms perl 5.40.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 122ms 4.1ms 33.2MB 90ms 30ms dotnet/aot 9.0.203
csharp 1.cs 143ms 1.7ms 42.2MB 120ms 13ms mono 6.12.0
csharp 1.cs 195ms 2.0ms 49.9MB 157ms 40ms dotnet 9.0.203
perl 1.pl 1814ms 6.8ms 14.4MB 1800ms 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 131ms 0.3ms 26.3MB 350ms 103ms dotnet/aot 9.0.203
csharp 5-m.cs 189ms 3.4ms 39.1MB 467ms 123ms dotnet 9.0.203
csharp 5-m.cs 241ms 13ms 51.4MB 660ms 123ms mono 6.12.0
perl 1.pl 3655ms 59ms 10.9MB 3640ms 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 25ms 0.4ms 15.4MB 37ms 10ms dotnet/aot 9.0.203
csharp 5-m.cs 60ms 1.1ms 36.9MB 80ms 20ms dotnet 9.0.203
csharp 5-m.cs 70ms 2.0ms 30.9MB 103ms 20ms mono 6.12.0
perl 1.pl 377ms 6.8ms 6.6MB 363ms 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.7ms 0.2ms 5.1MB 0ms 0ms perl 5.40.1
csharp 1.cs 9.0ms 3.9ms 6.8MB 0ms 0ms dotnet/aot 9.0.203
csharp 1.cs 31ms 0.6ms 21.3MB 20ms 0ms mono 6.12.0
csharp 1.cs 35ms 1.3ms 26.1MB 20ms 2ms dotnet 9.0.203

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 360ms 2.9ms 27.6MB 340ms 7ms dotnet 9.0.203
csharp 8.cs 371ms 1.0ms 9.9MB 360ms 0ms dotnet/aot 9.0.203
csharp 8.cs 419ms 1.8ms 27.4MB 400ms 3ms dotnet 9.0.203
csharp 8.cs 1254ms 9.8ms 22.8MB 1240ms 0ms mono 6.12.0
perl 2.pl timeout 0.0ms 6.1MB 4990ms 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.4ms 9.9MB 30ms 0ms dotnet/aot 9.0.203
csharp 9.cs 93ms 4.5ms 27.6MB 70ms 7ms dotnet 9.0.203
csharp 8.cs 99ms 8.1ms 27.6MB 80ms 3ms dotnet 9.0.203
csharp 8.cs 162ms 0.8ms 20.9MB 150ms 0ms mono 6.12.0
perl 2.pl 2936ms 340ms 6.1MB 2927ms 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 1860ms 1.8ms 10.4MB 7253ms 10ms dotnet/aot 9.0.203
csharp 3-m.cs 1926ms 4.5ms 29.9MB 7353ms 23ms dotnet 9.0.203
csharp 3-m.cs 4693ms 178ms 25.5MB 17890ms 10ms mono 6.12.0
perl 4.pl timeout 0.0ms 9.8MB 19750ms 10ms perl 5.40.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 494ms 33ms 10.5MB 1787ms 3ms dotnet/aot 9.0.203
csharp 3-m.cs 657ms 23ms 30.0MB 1690ms 10ms dotnet 9.0.203
csharp 3-m.cs 1197ms 19ms 27.2MB 4503ms 13ms mono 6.12.0
perl 4.pl timeout 0.0ms 10.1MB 19607ms 7ms perl 5.40.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 128ms 1.5ms 10.4MB 450ms 0ms dotnet/aot 9.0.203
csharp 3-m.cs 248ms 8.5ms 28.6MB 463ms 10ms dotnet 9.0.203
csharp 3-m.cs 352ms 13ms 24.8MB 1190ms 10ms mono 6.12.0
perl 4-m.pl 3406ms 24ms 9.6MB 13197ms 10ms perl 5.40.1