marinofelipe / swift-package-info

Swift CLI tool that provides information about a Swift Package
MIT License
76 stars 7 forks source link

Download vs Install Size #51

Open kibotu opened 7 months ago

kibotu commented 7 months ago

As far as I can tell, the output is always install size. For app install / update size optimisation we'd be interested in the compressed sizes as well. Any ideas?

marinofelipe commented 7 months ago

Hi @kibotu, good question

From what I recall the output is actually the download size, but the universal one. It should be possible to use thinning export options in order to have size report for a single variant, for a more "precise" download size.

And the thinning report has both compressed/download and uncompressed/install, which could be interesting for a more complete report.

https://developer.apple.com/documentation/xcode/reducing-your-app-s-size#Create-the-app-size-report

marinofelipe commented 7 months ago

In general, I think it's something interesting to look into and extend the tool to support :)

It could be something as:

What do you think @kibotu? Curious to about your ideas

kibotu commented 7 months ago

great ideas! not sure yet how to parameterize this project accordingly just yet though

kibotu commented 7 months ago

I've removed vision and macos as build destination of the example app

Screenshot 2024-04-23 at 09 50 15

and added -sdk iphoneos \ to the archive command

the binary sizes became smaller (from 4.8mb to 2.2mb) however if i run this on a few dependencies it quickly shows that the sizes don't add up to the final IPA.

IPA 17.1 MB

package 1 - 2,2 MB

Screenshot 2024-04-23 at 09 56 07

package 2 - 8,4 MB

Screenshot 2024-04-23 at 09 56 13

package 3 - 16,4 MB

Screenshot 2024-04-23 at 09 57 43

package 4 - 10,9 MB

Screenshot 2024-04-23 at 09 57 50

package 5 - 10,9 MB

Screenshot 2024-04-23 at 09 57 54

package 6 - 12,7 MB

Screenshot 2024-04-23 at 09 57 58

package 7 - 13,4 MB

Screenshot 2024-04-23 at 09 58 03

there are 29 modules in total.

to me it looks like the size includes dependencies, which makes it difficult to measure a single package.

is there a way to exclude other dependencies when measuring by any chance?

kibotu commented 7 months ago

Even if I subtract all the dependencies from each other, the app size still does not add up

Screenshot 2024-04-23 at 10 08 28