Performance issues in mobile applications (i.e., apps) often have a direct impact on the user experience. However, due to limited testing resources and fast-paced software development cycles, many performance issues remain undiscovered when the apps are released. As found by a prior study, these performance issues are one of the most common complaints that app users have. Unfortunately, there is a limited support to help developers avoid or detect performance issues in mobile apps.In this thesis, we conduct an empirical study on performance issues in iOS apps written in Swift language. To the best of our knowledge, this is the first study on performance issues of apps on the iOS platform. We manually studied 235 performance issues that are collected from four open source iOS apps. We found that most performance issues in iOS apps are related to inefficient UI design, memory issues, and inefficient thread handling. We also manually uncovered four performance anti-patterns that recurred in the studied issue reports. To help developers avoid these performance anti-patterns in the code, we implemented a static analysis tool called iPerfDetector. We evaluated iPerfDetector on eight open source and three commercial apps. iPerfDetector successfully detected 34 performance anti-pattern instances in the studied apps, where 31 of them are already confirmed and accepted by developers as potential performance issues. Our case study on the performance impact of the anti-patterns shows that fixing the anti-pattern may improve the performance (i.e., response time, GPU, or CPU) of the workload by up to 80%.iii I would like to thank my supervisor, Dr. Tse-hsun (Peter) Chen, whom without his persistent help and his guidance, this dissertation would not have been possible. I would also like to thank my committee members, for their suggestions and comments. vi
Contents
List of Figures ix
List of Tables xTable 5.3 GPU usage (percentage) changes in median, average, and standard deviation, after resolving the BLER and TREF anti-pattern instances. . . . . . . . . . . . . . Table 5.4 CPU usage changes (percentage) in median, average, and standard deviation, and response time changes (percentage) after resolving the DM anti-pattern