一句话:提出自动检测并改写 Android 应用中循环内触发低效 autocommit 的数据库写入,降低能耗并提升运行时性能。
移动应用常使用本地数据库存储数据,而数据库服务已成为移动设备资源消耗的主要来源之一。本文针对 Android 应用中低效的数据库写入,提出一种自动优化方法:先检测循环中会触发低效 autocommit 行为的数据库写入,再通过额外分析识别其中可优化者,并重写代码使其更高效。作者在应用市场中的 Android 应用上进行了评估,结果表明,包含低效数据库写入的事件其能耗与运行时分别可降低 25% 至 90%,且每个应用平均仅需 36 秒即可完成分析与转换。
Developers strive to build feature-filled apps that are responsive and consume as few resources as possible. Most of these apps make use of local databases to store and access data locally. Prior work has found that local database services have become one of the major drivers of a mobile device's resource consumption. In this paper we propose an approach to reduce the energy consumption and improve runtime performance of database operations in Android apps by optimizing inefficient database writes. Our approach automatically detects database writes that happen within loops and that will trigger inefficient autocommit behaviors. Our approach then uses additional analyses to identify those that are optimizable and rewrites the code so that it is more efficient. We evaluated our approach on a set of marketplace Android apps and found it could reduce the energy and runtime of events containing the inefficient database writes by 25% to 90% and needed, on average, thirty-six seconds to analyze and transform each app.
@inproceedings{paperbot4809,
title = {Remove RATs from your code: automated optimization of resource inefficient database writes for mobile applications},
author = {Yingjun Lyu and Ding Li and William G. J. Halfond},
booktitle = {ISSTA},
year = {2018},
doi = {10.1145/3213846.3213865}
}