Perl VS D benchmarks

Current benchmark data was generated on Wed May 25 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

* -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 3653ms 27ms 75.1MB 3940ms 20ms ldc2 1.29.0
d 1.d timeout 0.0ms 0.0MB 0ms 0ms dmd 2.100.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
d 1.d 300ms 2.5ms 15.1MB 290ms 0ms ldc2 1.29.0
d 1.d 469ms 8.4ms 16.3MB 457ms 3ms dmd 2.100.0
perl 1.pl 1991ms 5.7ms 14.4MB 1973ms 3ms perl 5.34.1

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 3920ms 281ms 10.8MB 3900ms 0ms perl 5.34.1

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 435ms 1.0ms 6.6MB 420ms 0ms perl 5.34.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 2.7ms 0.6ms 4.0MB 0ms 0ms dmd 2.100.0
d 1.d 3.3ms 1.9ms 3.0MB 0ms 0ms ldc2 1.29.0
perl 1.pl 4.2ms 1.5ms 5.0MB 0ms 0ms perl 5.34.1

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 463ms 9.0ms 1.2MB 450ms 0ms ldc2 1.29.0
d 2.d 487ms 1.8ms 1.2MB 473ms 0ms ldc2 1.29.0
d 1.d 1093ms 2.5ms 1.9MB 1080ms 0ms dmd 2.100.0
d 2.d 2903ms 0.8ms 2.0MB 2890ms 0ms dmd 2.100.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
d 1.d 51ms 0.7ms 1.2MB 40ms 0ms ldc2 1.29.0
d 2.d 52ms 0.3ms 1.2MB 40ms 0ms ldc2 1.29.0
d 1.d 127ms 0.4ms 2.0MB 120ms 0ms dmd 2.100.0
d 2.d 260ms 0.6ms 1.9MB 250ms 0ms dmd 2.100.0
perl 2.pl 3045ms 197ms 6.3MB 3027ms 0ms perl 5.34.1

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3889ms 1.5ms 3.8MB 3877ms 0ms ldc2 1.29.0
d 1.d 4416ms 24ms 4.6MB 4400ms 0ms dmd 2.100.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
d 1.d 977ms 1.0ms 3.6MB 963ms 0ms ldc2 1.29.0
d 1.d 1104ms 0.1ms 4.5MB 1093ms 0ms dmd 2.100.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
d 1.d 248ms 1.6ms 3.2MB 233ms 0ms ldc2 1.29.0
d 1.d 281ms 1.1ms 3.9MB 270ms 0ms dmd 2.100.0
perl 4-m.pl 4778ms 29ms 9.4MB 8997ms 0ms perl 5.34.1