Skip to main content
Log in

iPerfDetector: Characterizing and detecting performance anti-patterns in iOS applications

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

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 paper, 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 225 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%.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1

Similar content being viewed by others

Notes

  1. https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/

  2. https://github.com/mozilla-mobile/firefox-ios

  3. https://github.com/wordpress-mobile/WordPress-iOS

  4. https://github.com/wireapp/wire-ios

  5. https://github.com/danielgindi/Charts

  6. https://github.com/wordpress-mobile/WordPress-iOS/pull/578

  7. https://github.com/wordpress-mobile/WordPress-iOS/pull/578

  8. https://github.com/wordpress-mobile/WordPress-iOS/pull/578

  9. https://github.com/mozilla-mobile/firefox-ios/pull/1215/commits/4ba952a58bf34ecfa555a8058f7c9a20c154997d

  10. https://stackoverflow.com/questions/28137380/updating-ui-from-background-thread-swift

  11. https://github.com/wordpress-mobile/WordPress-iOS/pull/7864

  12. https://github.com/wordpress-mobile/WordPress-iOS/pull/7864

  13. https://bugzilla.mozilla.org/show_bug.cgi?id=1191058

  14. https://bugzilla.mozilla.org/show_bug.cgi?id=1191058

  15. https://bugzilla.mozilla.org/show_bug.cgi?id=1191058

  16. https://github.com/wordpress-mobile/WordPress-iOS/issues/419

  17. https://github.com/mozilla-mobile/firefox-ios/pull/1215/commits/4ba952a58bf34ecfa555a8058f7c9a20c154997d

  18. https://stackoverflow.com/questions/9270723/what-is-the-better-way-to-set-an-uiview-backgroundcolor-to-transparent

  19. https://www.linkedin.com/company/seeb/

  20. https://github.com/3lvis/Sync/issues/509

  21. https://github.com/hilen/TSWeChat/issues/42

  22. https://github.com/mozilla-mobile/firefox-ios/issues/3961

  23. https://github.com/wordpress-mobile/WordPress-iOS/pull/578

  24. https://github.com/wordpress-mobile/WordPress-iOS/issues/9993

  25. https://github.com/wordpress-mobile/WordPress-iOS/pull/10111

References

  • Afjehei SS, Chen T-HP (2018) iOS performance issue reports. https://docs.google.com/spreadsheets/d/1hX8IBcYIVv6x4nWfWczT5oLV0b1SMQK03q6_xC9B8eQ/edit#gid=1079185239. Accessed 2018-07-23

  • Apple (2012) Practical memory management. https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html. Accessed 2018-06-15

  • Apple (2015) More core data and concurrency. https://cocoacasts.com/more-core-data-and-concurrency. Accessed 2018-06-15

  • Apple (2017) Apple threading programming guide. https://developer.apple.com/documentation/code_diagnostics/main_thread_checker. Accessed 2018-06-15

  • Apple (2017) Nsmanagedobject programming guide. https://developer.apple.com/documentation/coredata/nsmanagedobjectcontext. Accessed 2018-06-15

  • Apple (2018a) Apple guide on swift programming language. https://developer.apple.com/swift/. Accessed 2018-06-15

  • Apple (2018b) Apple UIKit. https://developer.apple.com/documentation/uikit. Accessed 2018-06-15

  • Apple (2018c) Instruments. https://help.apple.com/instruments/mac/current/#/dev7b09c84f5/. Accessed 2018-07-23

  • Apple (2018d) Making core data your model layer. https://developer.apple.com/documentation/coredata/making_core_data_your_model_layer. Accessed 2018-06-15

  • Apple (2018e) Model-view-controller. https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html. Accessed 2018-06-15

  • Apple (2018f) Monitoring your app’s graphics activity. https://developer.apple.com/documentation/metal/tools_profiling_and_debugging/gpu_activity_monitors/monitoring_your_app_s_graphics_activity. Accessed 2018-07-23

  • Apple (2018g) Using core data in the background. https://developer.apple.com/documentation/coredata/using_core_data_in_the_background. Accessed 2018-06-15

  • Cassee N, Pinto G, Castor F, Serebrenik A (2018) How swift developers handle errors. In: 15Th international conference on mining software repositories (MSR 2018)

  • Chen T-H, Weiyi S, Jiang ZM, Hassan AE, Nasser M, Flora P (2014) Detecting performance anti-patterns for applications developed using object-relational mapping. In: Proceedings of the 36th international conference on software engineering (ICSE), pp 1001–1012

  • Chen T.-H., Shang W, Hassan AE, Nasser M, Flora P (2016a) Detecting problems in the database access code of large scale systems: an industrial experience report. In: Proceedings of the 38th international conference on software engineering companion, ICSE ’16, pp 71–80

  • Chen T-H, Shang W, Jiang ZM, Hassan AE, Nasser M, Flora P (2016b) Finding and evaluating the performance impact of redundant data access for applications that are developed using object-relational mapping frameworks. IEEE Trans Softw Eng 42(12):1148–1161

    Article  Google Scholar 

  • Chen T-H, Syer MD, Shang W, Jiang ZM, Hassan AE, Nasser M, Flora P (2017) Analytics-driven load testing: an industrial experience report on load testing of large-scale systems. In: Proceedings of the 39th international conference on software engineering: software engineering in practice track, ICSE-SEIP ’17, pp 243–252

  • Chowdhury S, Di Nardo S, Hindle A, Jiang ZMJ (2018) An exploratory study on assessing the energy impact of logging on android applications. Empir Softw Eng 23(3):1422–1456

    Article  Google Scholar 

  • Cruz L, Abreu R (2017) Performance-based guidelines for energy efficient mobile applications. In: 2017 IEEE/ACM 4th international conference on mobile software engineering and systems (MOBILESoft). IEEE, pp 46–57

  • Facebook (2017) Facebook’s infer static analysis tool. http://fbinfer.com/. Accessed 2018-06-15

  • Github (2018) Trending swift projects on github. https://github.com/trending/swift?since=monthly. Accessed 2018-06-15

  • Gottschalk M, Jelschen J, Winter A (2014) Saving energy on mobile devices by refactoring. In: EnviroInfo, pp 437–444

  • Grechanik M, Fu C, Xie Q (2012) Automatically finding performance problems with feedback-directed learning software testing. In: Proceedings of the 34th international conference on software engineering (ICSE), pp 156–166

  • Guide ACDP (2017) Core data programming guide. https://developer.apple.com/documentation/coredata. Accessed 2018-06-15

  • Habchi S, Hecht G, Rouvoy R, Moha N (2017) Code smells in ios apps: how do they compare to android?. In: Proceedings of the 4th international conference on mobile software engineering and systems. IEEE Press, pp 110–121

  • Hecht G, Moha N, Rouvoy R (2016) An empirical study of the performance impacts of Android code smells. In: Proceedings of the international workshop on mobile software engineering and systems. ACM, pp 59–69

  • Hu H, Bezemer C-P, Hassan AE (2018) Studying the consistency of star ratings and the complaints in 1 & 2-star user reviews for top free cross-platform android and iOS apps. Empir Softw Eng

  • Jiang ZM, Hassan AE, Hamann G, Flora P (2008) Automatic identification of load testing problems. In: Proceedings of 24th international conference on software maintenance (ICSM), pp 307–316

  • Jin G, Song L, Shi X, Scherpelz J, Lu S (2012a) Understanding and detecting real-world performance bugs. In: Proceedings of the 33rd ACM SIGPLAN conference on programming language design and implementation, PLDI ’12

  • Jin G, Song L, Shi X, Scherpelz J, Lu S (2012b) Understanding and detecting real-world performance bugs. In: Proceedings of the 33rd ACM SIGPLAN conference on programming language design and implementation, PLDI ’12, pp 77–88

  • Jin G, Song L, Shi X, Scherpelz J, Lu S (2012c) Understanding and detecting real-world performance bugs. ACM SIGPLAN Not 47(6):77–88

    Article  Google Scholar 

  • Jindal A, Pathak A, Hu YC, Midkiff S (2013) On death, taxes, and sleep disorder bugs in smartphones. In: Proceedings of the workshop on power-aware computing and systems. ACM, p 1

  • Khalid H, Shihab E, Nagappan M, Hassan AE (2015) What do mobile app users complain about? IEEE Softw 32(3):70–77

    Article  Google Scholar 

  • Lin Y, Okur S, Dig D (2015) Study and refactoring of android asynchronous programming (t). In: 2015 30th IEEE/ACM international conference on automated software engineering (ASE). IEEE, pp 224–235

  • Liu Y, Xu C, Cheung S-C (2014) Characterizing and detecting performance bugs for smartphone applications. In: Proceedings of the 36th international conference on software engineering. ACM, pp 1013–1024

  • Mannan UA, Ahmed I, Almurshed RAM, Dig D, Jensen C (2016) Understanding code smells in android applications. In: 2016 IEEE/ACM international conference on mobile software engineering and systems (MOBILESoft). IEEE, pp 225–236

  • Martin W, Sarro F, Jia Y, Zhang Y, Harman M (2017) A survey of app store analysis for software engineering. IEEE Trans Softw Eng 43(9):817–847

    Article  Google Scholar 

  • Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring: improving the design of existing code. Addison-Wesley, Reading

    Google Scholar 

  • McDonnell T, Ray B, Kim M (2013) An empirical study of api stability and adoption in the android ecosystem. In: Proceedings of the 2013 IEEE international conference on software maintenance, ICSM ’13, pp 70–79

  • Medium (2015) Diagnose and solve performance problems with xcode instruments. https://medium.com/@zhenya.peteliev/diagnose-and-solve-performance-problem-with-xcode-instruments-5c25c27f21d5. Accessed 2018-11-05

  • Medium (2016) 21 amazing open source iOS apps written in swift. https://medium.mybridge.co/21-amazing-open-source-ios-apps-written-in-swift-5e835afee98e. Accessed 2018-06-11

  • Morales R, Saborido R, Khomh F, Chicano F, Antoniol G (2017) Earmo: an energy-aware refactoring approach for mobile apps. IEEE Trans Softw Eng, (1):1–1

  • Nistor A, Jiang T, Tan L (2013a) Discovering, reporting, and fixing performance bugs. In: Proceedings of the 10th working conference on mining software repositories. IEEE Press, pp 237–246

  • Nistor A, Song L, Marinov D, Lu S (2013b) Toddler: detecting performance problems via similar memory-access patterns. In: Proceedings of the 2013 international conference on software engineering, ICSE ’13, pp 562–571

  • Nistor A, Chang P-C, Radoi C, Lu S (2015) Caramel: detecting and fixing performance problems that have non-intrusive fixes. In: Proceedings of the 2015 international conference on software engineering, ICSE ’15, pp 902–912

  • Okur S, Hartveld DL, Dig D, Deursen AV (2014) A study and toolkit for asynchronous programming in C#. In: Proceedings of the 36th international conference on software engineering. ACM, pp 1117–1127

  • Palomba F, Di Nucci D, Panichella A, Zaidman A, De Lucia A (2017) Lightweight detection of android-specific code smells: the adoctor project. In: Proceedings of the 24th international conference on software analysis, evolution and reengineering, SANER ’17, pp 487–491

  • Pathak A, Hu YC, Zhang M (2011) Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceedings of the 10th ACM workshop on hot topics in networks. ACM, p 5

  • Pathak A, Hu YC, Zhang M (2012) Where is the energy spent inside my app?: fine grained energy accounting on smartphones with eprof. In: Proceedings of the 7th ACM European conference on computer systems. ACM, pp 29–42

  • Rebouças M, Pinto G, Ebert F, Torres W, Serebrenik A, Castor F (2016) An empirical study on the usage of the swift programming language. In: 2016 IEEE 23rd international conference on software analysis, evolution, and reengineering (SANER). IEEE, pp 634–638

  • RedMonk (2018) The RedMonk programming language rankings: January 2018. http://redmonk.com/sogrady/2018/03/07/language-rankings-1-18/. Accessed 2018-06-11

  • Reimann J, Brylski M, Aßmann U (2014) A tool-supported quality smell catalogue for android developers. In: Proceeding of the conference modellierung 2014 in the workshop modellbasierte und modellgetriebene softwaremodernisierung–MMSM

  • Smith CU, Williams LG (2001) Software performance antipatterns; common performance problems and their solutions. In: Int CMG conference, pp 797–806

  • Statista (2018) Number of apps available in leading app stores. https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/. Accessed 2018-07-23

  • Statistia (2018) Number of apps available in leading app stores as of 1st quarter 2018. https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/. Accessed 2018-06-15

  • SwiftAST (2018) Swift-ast tool on github. https://github.com/yanagiba/swift-ast. Accessed 2018-6-30

  • Syer MD, Nagappan M, Hassan AE, Adams B (2013) Revisiting prior empirical findings for mobile apps: an empirical case study on the 15 most popular open-source android apps. In: Proceedings of the 2013 conference of the center for advanced studies on collaborative research, CASCON ’13, pp 283–297

  • Zaman S, Adams B, Hassan AE (2012) A qualitative study on performance bugs. In: Proceedings of the 9th IEEE working conference on mining software repositories. IEEE Press, pp 199–208

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tse-Hsun (Peter) Chen.

Additional information

Communicated by: David Lo, Meiyappan Nagappan, Fabio Palomba and Sebastian Panichella

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Afjehei, S.S., Chen, TH.(. & Tsantalis, N. iPerfDetector: Characterizing and detecting performance anti-patterns in iOS applications. Empir Software Eng 24, 3484–3513 (2019). https://doi.org/10.1007/s10664-019-09703-y

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-019-09703-y

Keywords

Navigation