Performance analysis of SwiftUI and UIKit : A comparison of CPU time and memory usage for common user interface elements

Detta är en Master-uppsats från KTH/Skolan för elektroteknik och datavetenskap (EECS)

Sammanfattning: In today's digital era, smartphones have evolved into an important part of our daily routine, thereby raising the bar for high-quality applications that deliver premium user experiences. In this landscape, UIKit and SwiftUI have emerged as two noteworthy user interface frameworks in the realm of iOS development, with UIKit having a longstanding foothold and SwiftUI displaying newer declarative coding style. The primary objective of this research was to investigate the performance of SwiftUI against UIKit, given the important role performance plays in shaping user experiences. Our investigative journey involved comparing the frameworks' performance based on parameters such as CPU time and memory usage for common user interface components. Our insights revealed that UIKit held a performance advantage over SwiftUI, generally outperforming it by approximately 25% when the component count was less than 32 and also displaying a consistent trend of lower memory consumption. This difference in performance could be consequential in contexts related to social media applications, where even minor delays can disrupt the user experience. SwiftUI extends advantages like reduced code length, faster development time, real-time previews, and enhanced code readability. Therefore, the decision of choosing between UIKit or SwiftUI should be driven by the particular requirements of the application in question rather than solely focusing on its performance. The study does carry certain limitations, including the absence of exact equivalent components between UIKit and SwiftUI in some scenarios, and a limited set of benchmarked iPhone models.

  HÄR KAN DU HÄMTA UPPSATSEN I FULLTEXT. (följ länken till nästa sida)