Perl VS D benchmarks

Current benchmark data was generated on Sat Jan 28 2023, 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
d 1.d 3074ms 49ms 75.1MB 3313ms 13ms ldc2 1.30.0
d 1.d 4033ms 80ms 185.0MB 4573ms 23ms dmd 2.101.2
perl 1.pl timeout 0.0ms 77.7MB 4957ms 23ms perl 5.36.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 271ms 8.3ms 15.2MB 263ms 0ms ldc2 1.30.0
d 1.d 332ms 4.3ms 26.5MB 340ms 0ms dmd 2.101.2
perl 1.pl 2227ms 6.1ms 14.0MB 2217ms 0ms perl 5.36.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 235ms 7.0ms 28.5MB 217ms 7ms ldc2 1.30.0
d 1.d 793ms 2.2ms 40.3MB 773ms 7ms dmd 2.101.2
perl 1.pl 4480ms 19ms 11.1MB 4463ms 0ms perl 5.36.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 28ms 1.8ms 7.4MB 17ms 0ms ldc2 1.30.0
d 1.d 82ms 0.7ms 9.2MB 70ms 0ms dmd 2.101.2
perl 1.pl 453ms 0.2ms 6.7MB 440ms 0ms perl 5.36.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 2.1ms 0.6ms 3.0MB 0ms 0ms ldc2 1.30.0
d 1.d 2.3ms 0.6ms 4.0MB 0ms 0ms dmd 2.101.2
perl 1.pl 2.8ms 0.7ms 5.0MB 0ms 0ms perl 5.36.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 409ms 1.3ms 1.5MB 400ms 0ms ldc2 1.30.0
d 2.d 422ms 0.1ms 1.5MB 410ms 0ms ldc2 1.30.0
d 1.d 1535ms 4.6ms 2.3MB 1523ms 0ms dmd 2.101.2
d 2.d 2861ms 4.3ms 2.3MB 2850ms 0ms dmd 2.101.2
perl 2.pl timeout 0.0ms 6.3MB 4987ms 0ms perl 5.36.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 43ms 0.4ms 1.6MB 33ms 0ms ldc2 1.30.0
d 2.d 45ms 0.1ms 1.5MB 37ms 0ms ldc2 1.30.0
d 1.d 156ms 0.5ms 2.3MB 150ms 0ms dmd 2.101.2
d 2.d 290ms 0.5ms 2.4MB 280ms 0ms dmd 2.101.2
perl 2.pl 3265ms 78ms 6.2MB 3257ms 0ms perl 5.36.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 4289ms 1.5ms 3.9MB 4280ms 0ms ldc2 1.30.0
d 1.d 4784ms 5.5ms 4.8MB 4773ms 0ms dmd 2.101.2
perl 4.pl timeout 0.0ms 8.2MB 9867ms 10ms perl 5.36.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1078ms 5.2ms 3.4MB 1067ms 0ms ldc2 1.30.0
d 1.d 1198ms 0.8ms 4.3MB 1190ms 0ms dmd 2.101.2
perl 4.pl timeout 0.0ms 9.7MB 9723ms 3ms perl 5.36.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 271ms 0.7ms 3.0MB 260ms 0ms ldc2 1.30.0
d 1.d 302ms 0.4ms 4.1MB 290ms 0ms dmd 2.101.2
perl 4-m.pl 4983ms 17ms 9.4MB 9713ms 3ms perl 5.36.0