/ably-cocoa-size-estimate

Estimating the amount that the ably-cocoa SDK contributes to an iOS app's size.

Primary LanguageSwift

How much larger does an iOS app become when you add the ably-cocoa SDK?

This aims to find out how much the ably-cocoa SDK contributes to the size of an iOS app.

Units

Here, "kB" means kilobyte and "MB" means megabyte.

Findings

Adding version 1.2.10 of the ably-cocoa SDK to an iOS app adds, at most:

  • between 298kB and 660kB to the app’s App Store download size
  • between 630kB and 813kB to the app’s installed size

The exact value within that range depends upon which device the app is being installed on.

We say "at most" because this value includes ably-cocoa's dependencies. If the app is already has some dependencies in common with ably-cocoa (which is unlikely given the specific nature of ably-cocoa's dependencies) then this value will be lower.

The App Store download size increase is in fact still an estimate, as described by Apple (see the App Store Connect documentation linked in Methodology):

Note: When your app is approved for the App Store, it is encrypted with DRM and recompressed. The added encryption and DRM affects the ability to compress your binary, and as a result you may see a larger App Store file size for your binary than the binary you uploaded in App Store Connect. The exact final size for your app cannot be determined in advance to the accuracy of a single byte.

Methodology

I created a sample iOS app, which can be found in this repo. I then created a branch, with-ably, and added the Swift package ably-cocoa v1.2.10 as a dependency.

I then used Xcode 13.4.1 to create an Archive build from each of these branches, and used Xcode to upload them to the App Store using the following settings:

App Store Connect distribution options window

I then used App Store Connect’s "View builds and build metadata" functionality (see "View the file sizes of a build" on the linked page) to gather information about the estimated size of the app.

According to Apple, this is the most accurate way to estimate an app’s App Store size:

(…) if your app is available through the App Store or the TestFlight app, App Store Connect provides the most accurate size information.

Data

  • The "without Ably" data is for commit 7cd4a9c of this repo.
  • The "with Ably" data is for commit b7167f8 of this repo.
Device type Download size Install size
Without Ably With Ably Increase Without Ably With Ably Increase
Universal 5.23 MB 6.44 MB 1.21 MB 14.0 MB 15.5 MB 1.5 MB
iPad (4th generation) 2.73 MB 3.29 MB 560 kB 6.45 MB 7.09 MB 640 kB
iPad (4th generation) Wi‑Fi + Cellular 2.73 MB 3.29 MB 560 kB 6.45 MB 7.09 MB 640 kB
iPad Air Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad mini 2 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad mini 2 Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad mini 3 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad mini 3 Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (12.9‑inch) (2nd generation) 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (12.9‑inch) (2nd generation) Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (10.5‑inch) 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (10.5‑inch) Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad (6th generation) 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad (6th generation) Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad (7th generation) Wi‑Fi + Cellular 134 KB 433 KB 299 kB 417 KB 1.22 MB 803 kB
iPad Pro (11‑inch) 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (11‑inch) Wi‑Fi + Cellular 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (12.9‑inch) (3rd generation) 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPad Pro (11‑inch) (2nd generation) 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPad Pro (11‑inch) (2nd generation) Wi‑Fi + Cellular 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPad Pro (12.9‑inch) (4th generation) 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPad Pro (12.9‑inch) (4th generation) Wi‑Fi + Cellular 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPad mini (5th generation) 144 KB 799 KB 655 kB 417 KB 1.23 MB 813 kB
iPad mini (6th generation) 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPad mini (6th generation) Wi-Fi + Cellular 135 KB 433 KB 298 kB 417 KB 1.22 MB 803 kB
iPhone 5 2.72 MB 3.28 MB 560 kB 6.44 MB 7.07 MB 630 kB
iPhone 5c 2.72 MB 3.28 MB 560 kB 6.44 MB 7.07 MB 630 kB
iPhone 5S 2.46 MB 3.11 MB 650 kB 7.55 MB 8.36 MB 810 kB
iPhone 7 2.46 MB 3.11 MB 650 kB 7.55 MB 8.36 MB 810 kB
iPhone 7 Plus 2.47 MB 3.13 MB 660 kB 7.57 MB 8.38 MB 810 kB
iPhone 11 128 KB 427 KB 299 kB 404 KB 1.21 MB 806 kB
iPhone 11 Pro 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPhone 11 Pro Max 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPhone SE (2nd generation) 121 KB 419 KB 298 kB 396 KB 1.20 MB 804 kB
iPhone 12 mini 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPhone 12 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPhone 12 Pro 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPhone 12 Pro Max 138 KB 436 KB 298 kB 421 KB 1.22 MB 799 kB
iPod touch (6th generation) 2.46 MB 3.11 MB 650 kB 7.55 MB 8.36 MB 810 kB