Perl VS Javascript benchmarks

Current benchmark data was generated on Sun Jan 29 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
javascript 1.js 1311ms 115ms 253.9MB 1557ms 67ms bun 0.5.1
javascript 1.js 3548ms 72ms 239.0MB 2617ms 1197ms node 19.5.0
perl 1.pl timeout 0.0ms 77.7MB 4963ms 17ms perl 5.36.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 121ms 2.4ms 101.4MB 103ms 20ms bun 0.5.1
javascript 1.js 170ms 5.1ms 70.0MB 153ms 20ms node 19.5.0
perl 1.pl 2232ms 31ms 14.1MB 2213ms 0ms perl 5.36.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 4617ms 201ms 10.9MB 4607ms 0ms perl 5.36.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 471ms 8.6ms 6.7MB 457ms 0ms perl 5.36.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 4.8ms 0.1ms 4.0MB 0ms 0ms perl 5.36.0
javascript 1.js 15ms 1.1ms 55.5MB 0ms 0ms bun 0.5.1
javascript 1.js 43ms 0.7ms 43.1MB 30ms 2ms node 19.5.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6.js 603ms 4.1ms 47.2MB 590ms 7ms node 19.5.0
javascript 6.js 1010ms 1.0ms 63.9MB 1000ms 7ms bun 0.5.1
perl 2.pl timeout 0.0ms 6.4MB 4987ms 0ms perl 5.36.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6.js 106ms 3.3ms 47.3MB 97ms 3ms node 19.5.0
javascript 6.js 122ms 2.4ms 70.0MB 120ms 3ms bun 0.5.1
perl 2.pl 3264ms 72ms 6.3MB 3247ms 3ms perl 5.36.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 2755ms 8.6ms 69.5MB 5193ms 17ms node 19.5.0
perl 4.pl timeout 0.0ms 8.1MB 9860ms 7ms perl 5.36.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 847ms 18ms 69.1MB 1480ms 17ms node 19.5.0
perl 4.pl timeout 0.0ms 9.5MB 9720ms 3ms perl 5.36.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6.js 388ms 18ms 70.3MB 527ms 20ms node 19.5.0
perl 4.pl timeout 0.0ms 8.4MB 9707ms 3ms perl 5.36.0