Perl VS C# benchmarks

Current benchmark data was generated on Sat Mar 29 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 936ms 4.1ms 186.8MB 927ms 150ms dotnet 9.0.202
csharp 1.cs 1043ms 56ms 186.1MB 1020ms 140ms dotnet/aot 9.0.202
csharp 1.cs 1768ms 82ms 102.0MB 1990ms 220ms mono 6.12.0
perl 1.pl timeout 0.0ms 77.8MB 4963ms 27ms perl 5.40.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 121ms 1.8ms 32.6MB 83ms 33ms dotnet/aot 9.0.202
csharp 1.cs 152ms 5.0ms 44.1MB 130ms 13ms mono 6.12.0
csharp 1.cs 204ms 10ms 53.0MB 160ms 40ms dotnet 9.0.202
perl 1.pl 1805ms 9.4ms 14.4MB 1790ms 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 133ms 5.3ms 22.5MB 363ms 100ms dotnet/aot 9.0.202
csharp 5-m.cs 201ms 11ms 38.4MB 463ms 130ms dotnet 9.0.202
csharp 5-m.cs 243ms 12ms 43.8MB 663ms 127ms mono 6.12.0
perl 1.pl 3618ms 29ms 10.9MB 3607ms 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 24ms 0.9ms 15.5MB 33ms 17ms dotnet/aot 9.0.202
csharp 5-m.cs 64ms 4.1ms 37.1MB 87ms 13ms dotnet 9.0.202
csharp 5-m.cs 72ms 0.8ms 31.4MB 103ms 27ms mono 6.12.0
perl 1.pl 369ms 1.3ms 6.6MB 360ms 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.6ms 0.2ms 5.1MB 0ms 0ms perl 5.40.1
csharp 1.cs 9.1ms 3.9ms 9.8MB 0ms 0ms dotnet/aot 9.0.202
csharp 1.cs 31ms 1.0ms 21.3MB 20ms 0ms mono 6.12.0
csharp 1.cs 35ms 0.9ms 26.3MB 18ms 8ms dotnet 9.0.202

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 359ms 1.0ms 27.5MB 340ms 7ms dotnet 9.0.202
csharp 8.cs 372ms 0.3ms 9.8MB 360ms 0ms dotnet/aot 9.0.202
csharp 8.cs 427ms 7.6ms 27.6MB 403ms 7ms dotnet 9.0.202
csharp 8.cs 1248ms 2.7ms 20.8MB 1233ms 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 47ms 1.0ms 9.9MB 33ms 0ms dotnet/aot 9.0.202
csharp 9.cs 92ms 0.8ms 27.6MB 73ms 3ms dotnet 9.0.202
csharp 8.cs 99ms 5.1ms 27.8MB 80ms 7ms dotnet 9.0.202
csharp 8.cs 165ms 1.1ms 22.5MB 150ms 0ms mono 6.12.0
perl 2.pl 2754ms 16ms 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 1879ms 22ms 10.4MB 7240ms 10ms dotnet/aot 9.0.202
csharp 3-m.cs 1974ms 78ms 29.9MB 7297ms 17ms dotnet 9.0.202
csharp 3-m.cs 4747ms 137ms 25.7MB 18010ms 23ms mono 6.12.0
perl 4.pl timeout 0.0ms 9.8MB 19777ms 7ms perl 5.40.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 483ms 11ms 10.5MB 1800ms 7ms dotnet/aot 9.0.202
csharp 3-m.cs 534ms 1.3ms 29.9MB 1873ms 13ms dotnet 9.0.202
csharp 3-m.cs 1230ms 55ms 25.6MB 4607ms 10ms mono 6.12.0
perl 4.pl timeout 0.0ms 10.3MB 19540ms 17ms 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 0.7ms 10.5MB 447ms 7ms dotnet/aot 9.0.202
csharp 3-m.cs 183ms 7.9ms 28.3MB 503ms 10ms dotnet 9.0.202
csharp 3-m.cs 354ms 10ms 24.9MB 1193ms 7ms mono 6.12.0
perl 4-m.pl 3406ms 19ms 9.6MB 13200ms 10ms perl 5.40.1