[
  {
    "path": "README.md",
    "content": "# iOS-Performance-Optimization\nThis project contains foundation knowledge and highly recommended resources on optimizing your iOS application performance.\nContributions are welcome 👋\n\n# Table of Contents\n\n- [Reduce App Size](#reduce-app-size)\n- [Reduce Build time](#reduce-build-time)\n- [App Launch time](#App-launch-time)\n- [App Runtime](#App-runtime)\n- [App Hang](#App-hang)\n- [Memory usage](#memory-usage)\n- [App Crash](#app-crash)\n- [CI](#ci)\n\n## Reduce App Size\n\n### Foundation knowledge\n\n- [Understand iOS App Size](https://docs.emergetools.com/docs/ios-app-size) by Emerge\n- [Understand static framework & dynamic framework](https://www.emergetools.com/blog/posts/static-vs-dynamic-frameworks-ios-discussion-chat-gpt) by Emerge\n- [Basic optimization to reduce app size](https://developer.apple.com/documentation/xcode/doing-basic-optimization-to-reduce-your-app-s-size) by Apple\n- [Advance optimization to reduce app size](https://developer.apple.com/documentation/xcode/doing-advanced-optimization-to-further-reduce-your-app-s-size) by Apple\n- [Reducing app size](https://developer.apple.com/documentation/xcode/reducing-your-app-s-size) by Apple\n- [Strip Binary Simple](https://docs.emergetools.com/docs/strip-binary-symbols)\n- [Xcode build time optimization](https://tech.autoscout24.com/blog/posts/xcode-build-time-optimization/)\n- [Are Android apps THAT much smaller than iOS?](https://www.emergetools.com/blog/posts/are-android-apps-really-that-much-smaller-than-ios) by Emerge\n\n### Tools\n\n- [Emerge Tool size Analysis](https://www.emergetools.com/uploads)\n- [Periphery - Static analysis - Unused code detection](https://github.com/peripheryapp/periphery) \n- [FengNiao - Unused image detection](https://github.com/onevcat/FengNiao)\n- [Reaper by Emerge](https://docs.emergetools.com/docs/reaper): Dynamic analysis for Unused code\n- [SmallStrings by Emerge](https://github.com/EmergeTools/SmallStrings): Reduce localisation size by 80%\n\n### Real-life example\n\n- [How Uber Deals with Large iOS App Size](https://www.uber.com/en-SG/blog/how-uber-deals-with-large-ios-app-size/)\n- [How 7 iOS Apps Could Save You 500MB of Storage](https://www.emergetools.com/blog/posts/7AppsThatCouldSaveYou500MB) by Emerge\n- [Spotify](https://www.youtube.com/watch?v=v3rYaEXzRh4)\n- [Make Your iOS App Smaller with Dynamic Frameworks](https://www.emergetools.com/blog/posts/make-your-ios-app-smaller-with-dynamic-frameworks)\n- [Manage Image Resources](https://medium.com/p/45681f475461)\n- [Duolingo remove 10000 lines of unused code by using Reaper](https://blog.duolingo.com/emerge-tools-reaper/)\n- [How the Tinder iOS App reduced the size of our localizations by 95%](https://medium.com/tinder/how-the-tinder-ios-app-reduced-the-size-of-our-localizations-by-95-using-emerge-af624d5b0ff0)\n\n## Reduce Build time\n\n### Foundation knowledge\n\n- [Clean build vs. Incremental build](https://emndeniz.medium.com/xcode-build-time-optimization-abee9893e4c8)\n- [Swift Compiler Performance](https://github.com/apple/swift/blob/main/docs/CompilerPerformance.md) by Apple\n- [Understanding Swift Performance](https://developer.apple.com/videos/play/wwdc2016/416/) by Apple: Understand how ARC works and how it impacts your app's performance\n- [Performance of value type](https://swiftrocks.com/memory-management-and-performance-of-value-types) by Swiftrocks\n\n### Tools\n\n- [Xcode Build time Rendering](https://github.com/PaulTaykalo/xcode-build-times-rendering)\n- [XCMetrics](https://github.com/spotify/XCMetrics)\n- [Tuist](https://github.com/tuist/tuist)\n- Bazel\n- [Cocoapod binary cache](https://github.com/grab/cocoapods-binary-cache) by Grab\n- [Build time analyzer](https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode): Measure the time Xcode takes to compile every funcs\n\n### Real-life example\n\n- [Grab](https://trinhngocthuyen.com/posts/tech/a-tale-of-project-build-time/)\n- [Gojek](https://medium.com/gojekengineering/reducing-our-build-time-by-50-835b54c99588)\n- [Tokopedia](https://medium.com/tokopedia-engineering/how-tokopedia-achieved-1000-faster-ios-build-time-7664b2d8ae5)\n- [Building faster](https://developer.apple.com/videos/play/wwdc2018/408) by Apple\n- [Caching SPM dependencies in CI](https://www.uptech.team/blog/swift-package-manager)\n\n## App launch time\n\n### Foundation knowledge\n\n- [About the app launch sequence](https://developer.apple.com/documentation/uikit/app_and_environment/responding_to_the_launch_of_your_app/about_the_app_launch_sequence) by Apple\n- [Cold launch vs Warm launch](https://developer.apple.com/documentation/xcode/reducing-your-app-s-launch-time#Understanding-cold-and-warm-launch): Apple\n- [Dynamic Linker vs Static Linker](https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/OverviewOfDynamicLibraries.html)\n- [Mach-O](https://medium.com/tokopedia-engineering/a-curious-case-of-mach-o-executable-26d5ecadd995)\n- [Dyld](https://www.emergetools.com/glossary/dyld)\n- [Protocol Conformance](https://www.emergetools.com/blog/posts/SwiftProtocolConformance)\n\n### Tools\n\n- Xcode Instruments\n\n### Real-life example\n\n- [Apple](https://developer.apple.com/documentation/xcode/reducing-your-app-s-launch-time)\n- [Uber](https://www.uber.com/en-SG/blog/measuring-performance-for-ios-apps-at-uber-scale/?uclick_id=50770e44-6b39-4177-9e17-b24247f0b7f6)\n- [Facebook Dynamic Loading](https://medium.com/@stevedao91/dynamic-loading-for-ios-6229d39a0a70)\n- [How Door Dash Reduced iOS App Launch Time by 60%](https://careers.doordash.com/blog/how-we-reduced-our-ios-app-launch-time-by-60/)\n- [Why Swift Reference Types Are Bad for App Startup Time](https://www.emergetools.com/blog/posts/SwiftReferenceTypes) - Emerge\n\n## App Runtime\n\n### Foundation Knowledge\n\n- [Thread explosion](https://swiftsenpai.com/swift/swift-concurrency-prevent-thread-explosion/) by SwiftSenpai\n- [Making efficient use of the libdispatch (GCD)](https://gist.github.com/tclementdev/6af616354912b0347cdf6db159c37057) by Apple engineer \n\n### Tools\n\n- [os signpost](https://www.donnywals.com/measuring-performance-with-os_signpost)\n- [ETTrace](https://github.com/EmergeTools/ETTrace)\n\n## App Hang\n\n### Foundation Knowledge\n\n- [Understanding hangs in your app](https://developer.apple.com/documentation/xcode/understanding-hangs-in-your-app)\n- [Understand and eliminate hangs from your app](https://developer.apple.com/videos/play/wwdc2021/10258/)\n\n### Tools\n\n- [Track down hangs with Xcode and on-device detection](https://developer.apple.com/videos/play/wwdc2022/10082/): track hangs during pre-release testing, show you how to identify issues in release builds using the Xcode Organizer\n- [Analyzing responsiveness issues in your shipping app](https://developer.apple.com/documentation/xcode/analyzing-responsiveness-issues-in-your-shipping-app)\n\n## Memory Usage\n\n### Foundation Knowledge\n\n- [You don't always need weak self](https://medium.com/@almalehdev/you-dont-always-need-weak-self-a778bec505ef)\n- [Nested closure weak self](https://medium.com/@almalehdev/the-nested-closure-trap-356a0145b6d)\n- [Detect Unused code using Memory graph debugger](https://careers.doordash.com/blog/ios-memory-leaks-and-retain-cycle-detection-using-xcodes-memory-graph-debugger/)\n- [Automating Memory Leak Detection with CI Integration](https://medium.com/gitconnected/automating-memory-leak-detection-with-ci-integration-for-ios-380f08a55f0b)\n- [Analyze Heap Memory](https://developer.apple.com/videos/play/wwdc2024/10173/): Apple WWDC\n- [Copy-on-write](https://holyswift.app/copy-on-write-in-swift/)\n\n### Tools \n\n- [Memory Leaks Check](https://github.com/hoangatuan/MemoryLeaksCheck): A tool for detecting memory leak in CI\n- [MLeaksFinder](https://github.com/Tencent/MLeaksFinder): Hooks the dealloc method to check whether an object still exists after being released, thereby determining if there is a memory leak\n- [FBRetainCycleDetector](https://github.com/facebook/FBRetainCycleDetector): Traverses strong references between objects and builds a reference graph. If it detects a cycle, it indicates a retain cycle issue\n\n### Real life examples\n\n- [The Memory Leak: An Xcode Detective Story by Emerge](https://www.emergetools.com/blog/posts/the-memory-leak-an-xcode-detective-story?utm_campaign%3DiOS%20CI%20Newsletter%26utm_medium%3Dweb%26utm_source%3DiOS%20CI%20Newsletter%20Issue%2051%26utm_content%3Dsep_23_24)\n\n## App Crash\n\n### Foundation Knowledge\n\n- [Diagnosing issues using crash reports and device logs](https://developer.apple.com/documentation/xcode/diagnosing-issues-using-crash-reports-and-device-logs) - A series of diagnosing crash issues by Apple\n\n### Tools\n\n- [KSCrash](https://github.com/kstenerud/KSCrash)\n\n## CI\n\n### Examples\n\n- [Performance testing on CI](https://testableapple.com/xctmetric/?issue=043&utm_source=fatbobman%20weekly%20issue%2043&utm_medium=email&utm_campaign=fatbobman%20weekly)\n- [Selective testing](https://medium.com/trendyol-tech/selective-unit-testing-on-ios-achieve-80-faster-feedback-42e865c8ce20)\n\n\n"
  }
]