Characterizing Energy Consumption of Third-Party API Libraries using API Utilization Profiles
A. Schuler, G. Anderst-Kotsis - Characterizing Energy Consumption of Third-Party API Libraries using API Utilization Profiles - 2020 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), Bari, Italy, 2020
Background: Third-party software libraries often serve as fundamental building blocks for developing applications. However, depending on such libraries for development raises a new concern, energy consumption, which has become more of an interest in the software engineering community in recent years. Understanding the energy implications of software design choices is an ongoing research challenge, especially when working with mobile devices that are constrained by limited battery life.
Aims: Our goal is to research approaches, which will support software developers to better comprehend the energy implications of software design choices on Android. For this study, we particularly focus on APIs from third-party libraries for which we research methods that will allow estimating the energy consumption without the need for specific measurement hardware and laborious measurements.
Method: To achieve the stipulated goal we introduce System API Utilization Profiles (uAPI) which are based on the general assumption, that the actual energy consumption of a library is directly tied to its utilization of the underlying System API. Furthermore, we provide a formal definition and implementation of the proposed uAPI profiles that are computed based on dynamic call graphs obtained from a library under test. To further show the connection between our proposed uAPI profiles and energy consumption, we empirically examined their correlation using two experiments. The first one is dedicated to Android I/O operations, the second one examines uAPI profiles based on a popular open-source library for JSON document processing.
In our empirical evaluation, we collected 1052 individual call graphs which we used as
an input to evaluate the proposed model and compare it with the actual
energy consumption measured. For each call graph, we measured the
energy consumption with special hardware and attributed the measurements to individual methods.
Based on that data, we examined a strong linear correlation between the proposed uAPI
profiles and the actual measured energy consumption.
Conclusions: uApi profiles serve as a lightweight and feasible approach to characterize
the energy characteristics of third-party libraries. Their computation does not involve any special hardware,
and there are no alterations on the target mobile device required. For future work, we investigate
possibilities to use the proposed uAPI profiles as a foundation for a regression model,
which would allow us to predict the energy consumption development of a library over time.