Perl VS C# benchmarks

Current benchmark data was generated on Fri May 20 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -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 1400ms 22ms 390.6MB 1260ms 180ms dotnet 6.0.300
csharp 1.cs 2295ms 25ms 103.2MB 2610ms 193ms mono 6.12.0
perl 1.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 1.cs 160ms 4.1ms 44.7MB 143ms 3ms mono 6.12.0
csharp 1.cs 194ms 16ms 93.0MB 140ms 20ms dotnet 6.0.300
perl 1.pl 2370ms 18ms 14.2MB 2353ms 3ms perl 5.34.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5-m.cs 386ms 15ms 89.8MB 553ms 117ms dotnet 6.0.300
csharp 5-m.cs 493ms 9.8ms 59.0MB 813ms 110ms mono 6.12.0
perl 1.pl 4382ms 65ms 10.9MB 4367ms 0ms perl 5.34.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 5.cs 90ms 15ms 36.1MB 100ms 33ms mono 6.12.0
csharp 5.cs 99ms 9.1ms 45.3MB 90ms 23ms dotnet 6.0.300
perl 1.pl 448ms 6.1ms 6.6MB 437ms 0ms perl 5.34.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 2.8ms 0.8ms 5.0MB 0ms 0ms perl 5.34.1
csharp 1.cs 19ms 0.4ms 24.3MB 10ms 0ms mono 6.12.0
csharp 1.cs 50ms 4.7ms 32.9MB 24ms 2ms dotnet 6.0.300

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 438ms 9.0ms 29.3MB 410ms 0ms dotnet 6.0.300
csharp 8.cs 537ms 3.7ms 29.1MB 503ms 3ms dotnet 6.0.300
csharp 8.cs 1110ms 1.7ms 27.0MB 1097ms 0ms mono 6.12.0
perl 2.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 9.cs 95ms 4.6ms 29.2MB 67ms 0ms dotnet 6.0.300
csharp 8.cs 101ms 4.9ms 31.2MB 77ms 0ms dotnet 6.0.300
csharp 8.cs 135ms 4.1ms 27.0MB 123ms 0ms mono 6.12.0
perl 2.pl 3240ms 29ms 6.4MB 3223ms 0ms perl 5.34.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 2999ms 510ms 30.9MB 5187ms 20ms dotnet 6.0.300
csharp 3.cs timeout 0.0ms 0.0MB 0ms 0ms mono 6.12.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 719ms 3.7ms 29.5MB 1297ms 13ms dotnet 6.0.300
csharp 3-m.cs 3181ms 129ms 29.4MB 6040ms 10ms mono 6.12.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
csharp 3-m.cs 235ms 3.5ms 30.1MB 360ms 3ms dotnet 6.0.300
csharp 3-m.cs 805ms 2.5ms 30.0MB 1530ms 3ms mono 6.12.0
perl 4.pl timeout 0.0ms 0.0MB 0ms 0ms perl 5.34.1