C++ and Kotlin performance on Android – a comparative analysis
Grzegorz Zaręba
grzegorz.zareba@pollub.edu.plLublin University of Technology (Poland)
Maciej Zarębski
Lublin University of Technology (Poland)
Jakub Smołka
Lublin University of Technology (Poland)
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 CompilationReferences
Globalne statystyki popularności wybranych systemów operacyjnych w latach 2022-2023, https://gs.statcounter.com/os-market-share, [28.06.2023]
Google Scholar
L. Corral, A. Sillitti, G. Succi. Mobile multiplatform development: An experiment for performance analysis, Procedia Computer Science 10 (2012) 736-743, https://doi.org/10.1016/j.procs.2012.06.094.
Google Scholar
R. Pereira, M. Couto, F. Ribeiro, R. Rua, J. Cunha, J. P. Fernandes, J. Saraiva, Energy Efficiency across Programming Languages: How Do Energy, Time, and Memory Relate, in: 10th ACM SIGPLAN International Conference (SLE’17), Vancouver, Canada, October 23– 24, 2017.
Google Scholar
S. Lee, J. W. Jeon, Benchmarking Java application using JNI and native C application on Android, in: International Conference on Control, Automation and Systems (ICCAS), Gyeonggi-do, Korea (South), October 3-4, 2012, 1160-1163.
Google Scholar
M. Siggel, How to bring compute intensive C++ base apps to Android, in: Free and Open Source Conference 9 (FrOSCon) Sankt Augustin, Germany, August 23-24, 2014.
Google Scholar
What Is C++ Used For? https://www.codecademy.com/resources/blog/what-is-c-plus-plus-used-for/, [30.05.2023].
Google Scholar
Kotlin for Android, https://kotlinlang.org/docs/android-overview.html, [22.06.2023].
Google Scholar
N-body simulation – Wikipedia, https://en.wikipedia.org/wiki/N-body_simulation, [22.06.2023].
Google Scholar
Authors
Maciej ZarębskiLublin University of Technology Poland
Authors
Jakub SmołkaLublin University of Technology Poland
Statistics
Abstract views: 432PDF downloads: 275
License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.