Journal of Information Processing
Online ISSN : 1882-6652
ISSN-L : 1882-6652
 
Performance Study of Kotlin and Java Programs with Bytecode Analysis
Hayataka Nakamura, Atsuya Sonoyama, Takeshi Kamiyama, Masato Oguchi, Saneyasu Yamaguchi
著者情報
ジャーナル フリー

2024 年 32 巻 p. 380-395

詳細
抄録

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.

著者関連情報
© 2024 by the Information Processing Society of Japan
前の記事 次の記事
feedback
Top