3 ms·
If I recall correctly kotlin by default compiles to bytecode of Java 1.6. So o be afair comparison you should enable kotlin to compile to 1.8. as it is bytecode
by jorgemf 9y ago
If I recall correctly kotlin by default compiles to bytecode of Java 1.6. So o be afair comparison you should enable kotlin to compile to 1.8. as it is bytecode anyway I would expect very similar performance. But comparing 1.6 with 1.8 it is obvious 1.6 would be slower.
- pjmlp 9y agoThe bytecode differences between 1.6 and 1.8 bytecodes are mainly invokedynamic and methodhandles. If Kotlin doesn't take advantage of them when targeting 1.8, the bytecode version won't do any difference.
- jorgemf 9y agoMy point is that kotlin by default targets 1.6. You need to specify to target 1.8 if you want to use it. So for me the experiment is broken. You should either compare java 1.6 with kotlin or set up kotlin to use 1.8 to compare with the same java version.