All Kotlin benchmarks

Current benchmark data was generated on Fri Jul 01 2022, 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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 807ms 19ms 604.4MB 780ms 167ms kotlin/jvm 17.0.2
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 158ms 6.1ms 109.4MB 143ms 30ms kotlin/jvm 17.0.2
1-m.kt 606ms 5.4ms 30.0MB 947ms 7ms kotlin/native 1.7.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.kt 3367ms 142ms 156.0MB 6337ms 113ms kotlin/jvm 17.0.2
1.kt 3867ms 18ms 159.8MB 4930ms 100ms kotlin/jvm 17.0.2
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0
2-m.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 860ms 26ms 94.2MB 1500ms 60ms kotlin/jvm 17.0.2
2-m.kt 1227ms 32ms 28.1MB 2170ms 53ms kotlin/native 1.7.0
2-m.kt 1355ms 122ms 105.6MB 2447ms 77ms kotlin/jvm 17.0.2
1.kt 1447ms 17ms 10.5MB 1660ms 10ms kotlin/native 1.7.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 3.2ms 1.6ms 1.2MB 0ms 0ms kotlin/native 1.7.0
1.kt 75ms 8.8ms 40.9MB 64ms 12ms kotlin/jvm 17.0.2

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/jvm 17.0.2
2.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/jvm 17.0.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.kt 2507ms 58ms 242.5MB 4177ms 337ms kotlin/jvm 17.0.2
1-m.kt 2660ms 113ms 241.1MB 4453ms 413ms kotlin/jvm 17.0.2

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 1317ms 20ms 199.9MB 2197ms 130ms kotlin/jvm 17.0.2

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/jvm 17.0.2

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.kt 288ms 11ms 113.6MB 413ms 40ms kotlin/jvm 17.0.2
1.kt 301ms 12ms 109.9MB 363ms 47ms kotlin/jvm 17.0.2
2.kt 568ms 3.5ms 52.2MB 790ms 23ms kotlin/native 1.7.0
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.kt 506ms 5.5ms 128.7MB 640ms 47ms kotlin/jvm 17.0.2
1.kt 594ms 3.9ms 134.2MB 653ms 40ms kotlin/jvm 17.0.2
2.kt 1792ms 33ms 121.2MB 2440ms 70ms kotlin/native 1.7.0
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 224ms 5.4ms 74.3MB 297ms 33ms kotlin/jvm 17.0.2
2-m.kt 226ms 3.4ms 78.5MB 317ms 33ms kotlin/jvm 17.0.2
2.kt 276ms 4.6ms 27.8MB 397ms 7ms kotlin/native 1.7.0
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 599ms 15ms 364.5MB 583ms 107ms kotlin/jvm 17.0.2
1.kt 3311ms 7.8ms 138.3MB 4713ms 73ms kotlin/native 1.7.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 232ms 6.7ms 221.4MB 207ms 67ms kotlin/jvm 17.0.2
1.kt 710ms 13ms 38.2MB 990ms 13ms kotlin/native 1.7.0

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 780ms 7.5ms 43.0MB 807ms 13ms kotlin/jvm 17.0.2
1n.kt 826ms 20ms 5.2MB 813ms 0ms kotlin/native 1.7.0

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1n.kt 85ms 1.7ms 1.2MB 73ms 0ms kotlin/native 1.7.0
1.kt 168ms 3.4ms 43.0MB 180ms 23ms kotlin/jvm 17.0.2

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/jvm 17.0.2
1n.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0
2n.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 1750ms 30ms 250.2MB 2083ms 87ms kotlin/jvm 17.0.2
1n.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0
2n.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/native 1.7.0

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt timeout 0.0ms 0.0MB 0ms 0ms kotlin/jvm 17.0.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 1679ms 27ms 189.2MB 2587ms 73ms kotlin/jvm 17.0.2