Performance Study of Kotlin and Java Programs with Bytecode Analysis

この論文をさがす

抄録

Kotlin is a newly proposed programming language that is highly compatible with Java. Typically, source code written in Kotlin is compiled into Java bytecode, which is then interpreted and executed by the Java Virtual Machines (JVMs). To achieve high performance, the codes (source code or bytecode) must be optimized for the existing Java virtual machines. In this paper, we evaluate the performance of loop processing in Kotlin and Java programs considering the existing JVM implementations. First, we perform micro-benchmarking of loop processing, such as for and while statements, using two popular JVM implementations. The results show that the performance depends on the description methods even for the same semantics. The performances can be classified into two groups: fast and slow, in both JVM implementations. Second, we compare the bytecodes generated by the compilers from the description methods of the fast and slow groups. We then show the differences between them, which are small and cannot be justified as the direct cause of a significant performance difference. Third, we compare the native codes generated by a just-in-time (JIT) compiler and show that the bytecode in the fast group is deeply optimized by the JIT compiler, while that in the slow group is not. In fact, small differences in the bytecode lead to differences in the behavior of the JIT compiler and to non-trivial performance gains.------------------------------This is a preprint of an article intended for publication Journal ofInformation Processing(JIP). This preprint should not be cited. Thisarticle should be cited as: Journal of Information Processing Vol.32(2024) (online)------------------------------

Kotlin is a newly proposed programming language that is highly compatible with Java. Typically, source code written in Kotlin is compiled into Java bytecode, which is then interpreted and executed by the Java Virtual Machines (JVMs). To achieve high performance, the codes (source code or bytecode) must be optimized for the existing Java virtual machines. In this paper, we evaluate the performance of loop processing in Kotlin and Java programs considering the existing JVM implementations. First, we perform micro-benchmarking of loop processing, such as for and while statements, using two popular JVM implementations. The results show that the performance depends on the description methods even for the same semantics. The performances can be classified into two groups: fast and slow, in both JVM implementations. Second, we compare the bytecodes generated by the compilers from the description methods of the fast and slow groups. We then show the differences between them, which are small and cannot be justified as the direct cause of a significant performance difference. Third, we compare the native codes generated by a just-in-time (JIT) compiler and show that the bytecode in the fast group is deeply optimized by the JIT compiler, while that in the slow group is not. In fact, small differences in the bytecode lead to differences in the behavior of the JIT compiler and to non-trivial performance gains.------------------------------This is a preprint of an article intended for publication Journal ofInformation Processing(JIP). This preprint should not be cited. Thisarticle should be cited as: Journal of Information Processing Vol.32(2024) (online)------------------------------

収録刊行物

詳細情報 詳細情報について

問題の指摘

ページトップへ