Php VS Kotlin benchmarks

Current benchmark data was generated on Mon Apr 14 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
kotlin 1.kt 513ms 4.4ms 577.8MB 603ms 107ms kotlin/jvm 21
kotlin 1.kt 4515ms 38ms 146.1MB 4703ms 67ms kotlin/native 2.1.20
php 1.php timeout 0.0ms 141.9MB 4957ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 126ms 1.8ms 161.2MB 150ms 37ms kotlin/jvm 21
kotlin 1.kt 318ms 32ms 17.9MB 327ms 7ms kotlin/native 2.1.20
php 1.php 625ms 5.0ms 63.0MB 593ms 17ms php 8.2.28

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 2.1ms 0.1ms 3.1MB 0ms 0ms kotlin/native 2.1.20
php 1.php 50ms 1.2ms 52.5MB 18ms 22ms php 8.2.28
kotlin 1.kt 67ms 2.3ms 47.7MB 82ms 16ms kotlin/jvm 21

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1.kt 391ms 4.1ms 682.5MB 453ms 93ms kotlin/jvm 21
kotlin 1.kt 2170ms 19ms 88.8MB 2273ms 40ms kotlin/native 2.1.20
php 1.php 4002ms 68ms 114.0MB 3960ms 27ms php 8.2.28

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
kotlin 1-m.kt 163ms 0.8ms 209.4MB 213ms 50ms kotlin/jvm 21
kotlin 1.kt 426ms 7.1ms 25.7MB 437ms 10ms kotlin/native 2.1.20
php 1.php 851ms 7.8ms 67.1MB 820ms 20ms php 8.2.28