Is Kotlin target JVM version effect the performance?

Hi Kotliners!

As I recall from Kotlin in Action, there are JVM version specific implementation differences for Kotlin. Are there any performance differences between targetting JVM 1.6 and JVM 1.8.

Thanks in advance!

You are confusing program performance and compiler performance. Kotlin compiler generate a bytecode and the bytecode is then interpreted by VM. Bytecode with higher target could use some additional features that are not available in previous versions of VM, so, yes, there could be an improvement, but probably not quite significant (the bytecode siz will be probably smaller though). What is more important is what platform you will run it on. JVM 11/ GRAAL could give a significant boost compared to JVM8 an JVM8 is much faster than JVM6.

1 Like