C++ and Kotlin performance on Android – a comparative analysis

Main Article Content

DOI

Grzegorz Zaręba

grzegorz.zareba@pollub.edu.pl

Maciej Zarębski

maciej.zarebski1@pollub.edu.pl

Jakub Smołka

jakub.smolka@pollub.pl

Abstract


The article discusses the comparison of C++ and Kotlin programming languages in a mobile environment. The authors performed a series of tests based on five selected algorithms: n-bodies, the nth term of the Fibonacci sequence, reading and writing a file, and bubble sort for both small and large sets of values. The tests were carried out in a way that allowed to determine the performance of the Kotlin language both when it uses the Just-in-Time compilation mechanism and when it is not used. The research was carried out both on a physical mobile device and emulators. Although the C⁠+⁠+ language outclassed its rival in most of the tests performed, Kotlin showed more than three times faster performance when bubble sorting on a small (20,000 values) array.


Keywords:

programming language comparison, C++, Kotlin, Just-In-Time Compilation

References

Article Details

Zaręba, G., Zarębski, M., & Smołka, J. (2024). C++ and Kotlin performance on Android – a comparative analysis. Journal of Computer Sciences Institute, 30, 21–25. https://doi.org/10.35784/jcsi.5299