Perl VS D benchmarks

Current benchmark data was generated on Fri Aug 01 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
d 1.d 2187ms 1.9ms 312.5MB 2160ms 33ms ldc2 1.41.0
d 1.d 3000ms 18ms 314.1MB 3163ms 50ms dmd 2.111.0
perl 1.pl timeout 0.0ms 77.8MB 4960ms 23ms perl 5.40.2

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 205ms 3.2ms 207.9MB 180ms 13ms ldc2 1.41.0
d 1.d 262ms 1.9ms 209.7MB 237ms 10ms dmd 2.111.0
perl 1.pl 1828ms 6.1ms 14.4MB 1813ms 0ms perl 5.40.2

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 112ms 2.7ms 2.9MB 103ms 0ms ldc2 1.41.0
d 1.d 641ms 1.0ms 4.6MB 630ms 0ms dmd 2.111.0
perl 1.pl 3986ms 706ms 10.9MB 3973ms 0ms perl 5.40.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 14ms 0.5ms 2.9MB 10ms 0ms ldc2 1.41.0
d 1.d 67ms 0.8ms 4.8MB 60ms 0ms dmd 2.111.0
perl 1.pl 369ms 7.7ms 6.6MB 360ms 0ms perl 5.40.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1.6ms 0.1ms 2.9MB 0ms 0ms ldc2 1.41.0
d 1.d 2.0ms 0.2ms 5.1MB 0ms 0ms dmd 2.111.0
perl 1.pl 2.4ms 0.1ms 5.1MB 0ms 0ms perl 5.40.2

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 361ms 0.5ms 2.9MB 350ms 0ms ldc2 1.41.0
d 2.d 361ms 1.4ms 2.9MB 350ms 0ms ldc2 1.41.0
d 1.d 683ms 2.2ms 4.8MB 673ms 0ms dmd 2.111.0
d 2.d 2033ms 7.1ms 4.8MB 2023ms 0ms dmd 2.111.0
perl 2.pl timeout 0.0ms 6.1MB 4990ms 0ms perl 5.40.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 2.d 39ms 0.7ms 2.9MB 30ms 0ms ldc2 1.41.0
d 1.d 39ms 0.3ms 2.9MB 30ms 0ms ldc2 1.41.0
d 1.d 71ms 1.1ms 4.8MB 60ms 0ms dmd 2.111.0
d 2.d 208ms 2.9ms 4.8MB 200ms 0ms dmd 2.111.0
perl 2.pl 2772ms 20ms 6.1MB 2760ms 0ms perl 5.40.2

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3597ms 3.2ms 6.2MB 3587ms 0ms ldc2 1.41.0
d 1.d 3655ms 25ms 8.4MB 3643ms 0ms dmd 2.111.0
perl 4.pl timeout 0.0ms 9.8MB 19817ms 7ms perl 5.40.2

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 901ms 0.9ms 3.5MB 890ms 0ms ldc2 1.41.0
d 1.d 921ms 9.3ms 5.3MB 910ms 0ms dmd 2.111.0
perl 4.pl timeout 0.0ms 10.0MB 19533ms 7ms perl 5.40.2

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 228ms 1.4ms 3.3MB 220ms 0ms ldc2 1.41.0
d 1.d 233ms 1.9ms 7.2MB 220ms 0ms dmd 2.111.0
perl 4-m.pl 3437ms 29ms 9.6MB 13277ms 10ms perl 5.40.2