The Computer Language
Benchmarks Game

Java versus Kotlin fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

pidigits
source secs mem gz busy cpu load
Java 3.07 38,408 938 3.39 0% 8% 99% 3%
Kotlin 19.86 199,604 800 21.51 2% 49% 52% 5%
fannkuch-redux
source secs mem gz busy cpu load
Java 17.89 33,352 1282 70.90 98% 100% 100% 99%
Kotlin 63.38 34,592 1277 64.01 0% 93% 8% 1%
fasta
source secs mem gz busy cpu load
Java 2.23 43,292 2473 6.05 63% 48% 92% 68%
Kotlin 5.90 35,464 1514 6.35 2% 2% 5% 99%
reverse-complement
source secs mem gz busy cpu load
Java 3.14 730,620 2183 7.02 72% 45% 51% 55%
Kotlin 4.65 752,556 2136 8.43 27% 31% 96% 27%
mandelbrot
source secs mem gz busy cpu load
Java 5.93 76,272 796 23.28 97% 99% 98% 98%
Kotlin 7.04 79,052 873 27.67 98% 98% 99% 98%
spectral-norm
source secs mem gz busy cpu load
Java 4.14 36,456 950 16.16 97% 99% 98% 97%
Kotlin 4.21 36,552 868 16.47 99% 97% 97% 98%
n-body
source secs mem gz busy cpu load
Java 22.67 34,892 1429 23.01 1% 0% 0% 100%
Kotlin 22.19 35,304 1452 22.71 93% 0% 0% 9%
binary-trees
source secs mem gz busy cpu load
Java 8.25 964,656 835 27.65 79% 96% 76% 84%
Kotlin 8.07 848,160 769 26.97 82% 74% 80% 98%
regex-redux
source secs mem gz busy cpu load
Java 10.13 644,456 929 31.05 73% 75% 91% 67%
Kotlin   Bad Output
k-nucleotide
source secs mem gz busy cpu load
Java 9.08 404,688 1812 29.03 77% 77% 93% 73%
Kotlin   Failed
Java

openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

Kotlin

kotlinc-jvm 1.4-M1 (JRE 14+36-1461)

openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)