Perl VS Javascript benchmarks

Current benchmark data was generated on Thu Jul 13 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 1144ms 13ms 191.4MB 1403ms 47ms bun 0.6.14
javascript 1.js 3424ms 30ms 266.2MB 2693ms 1280ms node 20.4.0
perl 1.pl timeout 0.0ms 77.5MB 4963ms 20ms perl 5.38.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 1.js 116ms 4.2ms 105.5MB 107ms 13ms bun 0.6.14
javascript 1.js 174ms 4.1ms 68.2MB 153ms 27ms node 20.4.0
perl 1.pl 2195ms 12ms 14.1MB 2183ms 0ms perl 5.38.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 4570ms 33ms 10.8MB 4553ms 0ms perl 5.38.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 468ms 4.8ms 6.6MB 453ms 0ms perl 5.38.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 3.0ms 0.6ms 4.9MB 0ms 0ms perl 5.38.0
javascript 1.js 16ms 0.7ms 52.2MB 0ms 10ms bun 0.6.14
javascript 1.js 44ms 4.7ms 40.9MB 26ms 8ms node 20.4.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6.js 611ms 7.4ms 45.7MB 590ms 17ms node 20.4.0
javascript 6.js 1018ms 11ms 74.0MB 1010ms 0ms bun 0.6.14
perl 2.pl timeout 0.0ms 6.2MB 4987ms 0ms perl 5.38.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6.js 111ms 1.6ms 45.8MB 90ms 17ms node 20.4.0
javascript 6.js 123ms 0.5ms 75.7MB 120ms 7ms bun 0.6.14
perl 2.pl 3183ms 17ms 6.2MB 3167ms 0ms perl 5.38.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 2651ms 11ms 66.6MB 5087ms 50ms node 20.4.0
perl 4.pl timeout 0.0ms 8.5MB 9860ms 7ms perl 5.38.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 768ms 3.5ms 64.1MB 1393ms 47ms node 20.4.0
perl 4.pl timeout 0.0ms 10.1MB 9760ms 3ms perl 5.38.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 6-m.js 303ms 6.8ms 68.3MB 477ms 33ms node 20.4.0
perl 4-m.pl 4699ms 56ms 8.8MB 9137ms 7ms perl 5.38.0