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

Michael Peters, Gian Luca Scoccia, I. Malavolta
{"title":"How does Migrating to Kotlin Impact the Run-time Efficiency of Android Apps?","authors":"Michael Peters, Gian Luca Scoccia, I. Malavolta","doi":"10.1109/SCAM52516.2021.00014","DOIUrl":null,"url":null,"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%).","PeriodicalId":380117,"journal":{"name":"2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM)","volume":"240 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"7","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAM52516.2021.00014","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 7

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%).
迁移到Kotlin如何影响Android应用程序的运行时效率?
上下文。长期使用Java 6开发Android应用程序的Android开发人员在2017年被引入Kotlin作为一种新的编程语言。Kotlin包含许多特性,使其成为Android开发中Java的流行替代品,加上谷歌及其创建者Jetbrains的全力支持,它正在成为Android开发的重要组成部分。的目标。本研究旨在实证评估从Java迁移到Kotlin对Android应用运行时效率的影响。方法。为了实现这一目标,我们挖掘了7972个GitHub Android应用程序库,并确定了451个包含Kotlin代码的应用程序。然后,通过应用跨语言克隆检测技术,我们检测到62次提交,这些提交代表了向Kotlin的完全迁移,同时保持应用程序的功能等效。我们选取了10个完全迁移到Kotlin的应用程序,并进行了一个基于度量的实验,比较了它们的Java和Kotlin版本在7个运行时效率指标方面的差异。结果。我们的研究表明,迁移到Kotlin对CPU使用、内存使用和帧渲染持续时间有统计上显著的影响(尽管影响大小可以忽略不计),而对垃圾收集器的调用次数、延迟帧的数量、应用程序大小和能耗没有显著影响。结论。这项研究提供的证据表明,开发人员可以将他们的Android应用程序迁移到Kotlin,并期望在运行时具有相当的效率。作为副产品,这项研究还证实了大多数开源Android应用要么完全迁移到Kotlin(大约90%的Kotlin代码),要么只包含少量Kotlin代码(<10%)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信