How does Migrating to Kotlin Impact the Run-Time Efficiency of Android Apps?

M. Peters, G.L. Scoccia, I. Malavolta

Research output: Chapter in Book / Report / Conference proceedingConference contributionAcademicpeer-review

302 Downloads (Pure)

Abstract

Context. Android developers that developed Android apps using Java 6 for a long time got introduced to Kotlin as a new programming language in 2017. Kotlin contains many features that make it a popular alternative to Java in Android development, and together with the full support of Google and its creator, Jetbrains, it is becoming an essential part of Android development. Goal. This study aims to empirically assess the impact of the migration from Java to Kotlin on the run-Time efficiency of Android apps. Methodology. To achieve this goal, we mine 7,972 GitHub repositories of Android apps and identified 451 apps containing Kotlin code. Then, by applying a crosslanguage clone detection technique, we detect 62 commits that represent a full migration to Kotlin, while keeping the app functionally equivalent. We sample 10 apps that fully migrated to Kotlin and conducted a measurement-based experiment to compare their Java and Kotlin versions with respect to seven runtime efficiency metrics. Results. Our study shows that migrating to Kotlin has a statistically significant impact on CPU usage, memory usage, and render duration of frames (though with a negligible effect size), whereas it does not impact significantly the number of calls to the garbage collector, the number of delayed frames, app size, and energy consumption. Conclusions. This study provides evidence that developers can migrate their Android apps to Kotlin and expect comparable efficiency at runtime. As a side product, this study also confirms that most open-source Android apps either fully migrated to Kotlin (>90% Kotlin code) or contain low portions of Kotlin code (<10%).
Original languageEnglish
Title of host publication2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM)
Subtitle of host publication[Proceedings]
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages36-46
Number of pages11
ISBN (Electronic)9781665448970
ISBN (Print)9781665448987
DOIs
Publication statusPublished - 2021
Event21st IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2021 - Virtual, Luxembourg City, Luxembourg
Duration: 27 Sept 20211 Oct 2021

Conference

Conference21st IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2021
Country/TerritoryLuxembourg
CityVirtual, Luxembourg City
Period27/09/211/10/21

Fingerprint

Dive into the research topics of 'How does Migrating to Kotlin Impact the Run-Time Efficiency of Android Apps?'. Together they form a unique fingerprint.

Cite this