Perl VS Kotlin benchmarks

Current benchmark data was generated on Wed Feb 08 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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
kotlin 1.kt 793ms 13ms 413.5MB 770ms 157ms kotlin/jvm 17.0.2
kotlin 1.kt timeout 0.0ms 194.4MB 8290ms 1107ms kotlin/native 1.8.10
perl 1.pl timeout 0.0ms 77.7MB 4957ms 27ms perl 5.36.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 155ms 4.2ms 109.3MB 123ms 43ms kotlin/jvm 17.0.2
kotlin 1-m.kt 657ms 26ms 34.4MB 1093ms 130ms kotlin/native 1.8.10
perl 1.pl 2570ms 26ms 14.3MB 2550ms 3ms perl 5.36.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl timeout 0.0ms 11.1MB 4970ms 3ms perl 5.36.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 1.pl 536ms 6.3ms 6.8MB 523ms 0ms perl 5.36.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 2.6ms 0.4ms 1.5MB 0ms 0ms kotlin/native 1.8.10
perl 1.pl 3.8ms 0.6ms 5.1MB 0ms 0ms perl 5.36.0
kotlin 1.kt 78ms 1.3ms 40.7MB 62ms 10ms kotlin/jvm 17.0.2

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 768ms 9.5ms 42.9MB 757ms 27ms kotlin/jvm 17.0.2
kotlin 1n.kt 837ms 45ms 1.5MB 827ms 0ms kotlin/native 1.8.10
perl 2.pl timeout 0.0ms 6.4MB 4987ms 3ms perl 5.36.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1n.kt 88ms 3.6ms 1.5MB 80ms 0ms kotlin/native 1.8.10
kotlin 1.kt 185ms 11ms 43.0MB 183ms 20ms kotlin/jvm 17.0.2
perl 2.pl 3680ms 19ms 6.3MB 3667ms 0ms perl 5.36.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 8.2MB 9847ms 3ms perl 5.36.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 9.6MB 9703ms 3ms perl 5.36.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
perl 4.pl timeout 0.0ms 8.3MB 9687ms 10ms perl 5.36.0