All Kotlin benchmarks

Current benchmark data was generated on Wed Mar 22 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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 656ms 5.2ms 413.6MB 657ms 93ms kotlin/jvm 17.0.2
1.kt timeout 0.0ms 214.3MB 8420ms 1133ms kotlin/native 1.8.10

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 139ms 8.8ms 109.7MB 110ms 33ms kotlin/jvm 17.0.2
1-m.kt 537ms 10ms 34.4MB 913ms 107ms kotlin/native 1.8.10

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 2871ms 113ms 160.2MB 3643ms 63ms kotlin/jvm 17.0.2
2-m.kt 2981ms 233ms 155.2MB 5667ms 80ms kotlin/jvm 17.0.2
1.kt timeout 0.0ms 10.7MB 6233ms 313ms kotlin/native 1.8.10
2-m.kt timeout 0.0ms 29.9MB 9310ms 160ms kotlin/native 1.8.10

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 705ms 19ms 95.1MB 1220ms 53ms kotlin/jvm 17.0.2
2-m.kt 989ms 35ms 23.9MB 1770ms 47ms kotlin/native 1.8.10
2-m.kt 1005ms 89ms 113.5MB 1827ms 40ms kotlin/jvm 17.0.2
1.kt 1111ms 13ms 8.9MB 1390ms 50ms kotlin/native 1.8.10

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 2.6ms 0.6ms 1.5MB 0ms 0ms kotlin/native 1.8.10
1.kt 65ms 6.4ms 40.8MB 52ms 14ms kotlin/jvm 17.0.2

http-server

Input: 3000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 117ms 203ms 295.0MB 5953ms 593ms kotlin/jvm 17.0.2
2.kt timeout 0.0ms 310.3MB 8710ms 783ms kotlin/jvm 17.0.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.kt 2335ms 257ms 199.0MB 2620ms 173ms kotlin/jvm 17.0.2
1-m.kt 2846ms 78ms 189.6MB 4377ms 317ms 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 994ms 22ms 215.9MB 1720ms 67ms kotlin/jvm 17.0.2

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 3985ms 160ms 943.4MB 5933ms 270ms 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 225ms 1.4ms 113.5MB 333ms 23ms kotlin/jvm 17.0.2
1.kt 247ms 2.9ms 109.6MB 297ms 27ms kotlin/jvm 17.0.2
2-m.kt 447ms 8.6ms 40.5MB 720ms 7ms kotlin/native 1.8.10
1.kt timeout 0.0ms 15.0MB 4997ms 3ms kotlin/native 1.8.10

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.kt 371ms 1.6ms 127.2MB 473ms 30ms kotlin/jvm 17.0.2
1.kt 462ms 4.9ms 132.7MB 510ms 30ms kotlin/jvm 17.0.2
2-m.kt 1367ms 39ms 142.0MB 2207ms 63ms kotlin/native 1.8.10
1.kt timeout 0.0ms 14.9MB 4993ms 7ms kotlin/native 1.8.10

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 177ms 3.1ms 75.9MB 247ms 20ms kotlin/jvm 17.0.2
2-m.kt 193ms 2.4ms 78.7MB 277ms 13ms kotlin/jvm 17.0.2
2-m.kt 231ms 9.4ms 30.3MB 383ms 3ms kotlin/native 1.8.10
1.kt timeout 0.0ms 17.1MB 4997ms 7ms kotlin/native 1.8.10

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 459ms 5.2ms 286.1MB 453ms 70ms kotlin/jvm 17.0.2
1-m.kt 2820ms 21ms 138.6MB 4560ms 530ms kotlin/native 1.8.10

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 186ms 0.9ms 220.2MB 157ms 57ms kotlin/jvm 17.0.2
1-m.kt 572ms 5.4ms 38.5MB 907ms 117ms kotlin/native 1.8.10

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1n.kt 562ms 26ms 1.5MB 550ms 0ms kotlin/native 1.8.10
1.kt 582ms 3.1ms 42.7MB 587ms 13ms kotlin/jvm 17.0.2

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1n.kt 60ms 2.5ms 1.5MB 50ms 0ms kotlin/native 1.8.10
1.kt 142ms 1.5ms 42.9MB 147ms 13ms 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 212.1MB 5393ms 80ms kotlin/jvm 17.0.2
1n.kt timeout 0.0ms 10.9MB 6323ms 180ms kotlin/native 1.8.10
2n.kt timeout 0.0ms 9.2MB 5020ms 123ms kotlin/native 1.8.10

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 1502ms 21ms 244.4MB 1873ms 67ms kotlin/jvm 17.0.2
1n.kt timeout 0.0ms 20.9MB 6337ms 140ms kotlin/native 1.8.10
2n.kt timeout 0.0ms 11.3MB 5017ms 127ms kotlin/native 1.8.10

regex-redux

Input: 2500000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt timeout 0.0ms 154.8MB 5357ms 47ms kotlin/jvm 17.0.2
1n.kt timeout 0.0ms 277.3MB 5637ms 527ms kotlin/native 1.8.10

Input: 250000_in

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 1095ms 5.3ms 95.3MB 1447ms 40ms kotlin/jvm 17.0.2
1n.kt 4434ms 37ms 65.4MB 5727ms 13ms kotlin/native 1.8.10

secp256k1

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.kt 4488ms 23ms 185.0MB 5407ms 60ms kotlin/jvm 17.0.2

Input: 500

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.kt 1377ms 6.1ms 186.0MB 2130ms 60ms kotlin/jvm 17.0.2