Replies: 12 comments 1 reply
-
Yea this is interesting and that's a great, real-world stat that people do/should care about. It's worth checking out how accurate it turns out to be, and how best to display it. |
Beta Was this translation helpful? Give feedback.
-
Worth noting that @marinofelipe's swift-package-info was updated recently to support JSON output as well as calculating sizes for a local package (doesn't duplicate the download time which it was doing before) So we'd essentially just need to run:
I'm not sure exactly how, but I feel like it could do with it's own "job" triggered at the same time as the iOS, macOS (etc) builds that we currently do? It would essentially be an "analysis" phase which uploads its data slightly differently. It would power things such as the binary size impact and, in the future, things like documentation generation? @daveverwer @finestructure I wonder if you have any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
Yes, the integration is the slightly tricky bit. I haven't thought this through in detail but my hunch is that we could build and add the binary to the docker image and then shell out just like we do for Alternatively, a cleaner approach would be to see if swift-package-info could ship a library (if it doesn't already) that we embed and use. |
Beta Was this translation helpful? Give feedback.
-
It doesn't current surface itself as a library, but that's a relatively minor change that I'm sure we (I or Felipe) could add to the package upstream. I suppose my concern would be over the time it takes. It essentially has to archive an application using the package which will take minutes - would we want to block the ingest for that long while we run these calculations? I'm not saying yes/no - genuinely unsure if that would cause problems given some packages take 15 odd minutes to build! |
Beta Was this translation helpful? Give feedback.
-
Jumping in here... Yep,
Yes, for packages that have a deep dependency graph, it takes a while. Unfortunately we are constrained to
|
Beta Was this translation helpful? Give feedback.
-
Phew, that’s going to be too harsh for our runners (although it might an extreme case) 😅
It just occurred to me that we’re already building every package and perhaps we can get a decent estimate of binary size from the build products we already have. A big problem here is that they’re debug builds and I don’t think we want to switch to release builds, for performance reasons.
But maybe even so it might be good enough for t shirt size estimates? Surely there must be enough correlation between debug and release build size for all but the most convoluted cases.
Might be worth running some tests.
… On 24 Mar 2021, at 22:00, Felipe Lefèvre Marino ***@***.***> wrote:
It doesn't current surface itself as a library, but that's a relatively minor change that I'm sure we (I or Felipe) could add to the package upstream.
Jumping in here... Yep, swift-package-info is done with modularity in mind, so we could without much work and some tweaks provide a library a part from the executable module Run.
I suppose my concern would be over the time it takes. It essentially has to archive an application using the package which will take minutes...
Yes, for packages that have a deep dependency graph, it takes a while. Unfortunately we are constrained to xcodebuild archive which doesn't perform quite well.
Another downside is that, even more for virtual machines, the memory consumption of it can be high, which can be tricky.
For example, running it for FirebaseCrashlytics in my machine (1,4 GHz Quad-Core Intel Core i5 / 16 GB RAM / with Xcode closed 😛 ):
/usr/bin/time -lp swift-package-info --for https://github.com/firebase/firebase-ios-sdk -v 7.6.0 --product FirebaseCrashlytics --report jsonDump
real 55.33
user 25.69
sys 11.82
284663808 maximum resident set size
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Beta Was this translation helpful? Give feedback.
-
Firebase is definitely a bit of an edge case, it's something I've experienced in my own use cases where it spiked my CI build times (on CircleCI) by over 10 minutes once I added the dependency. As you say precision doesn't have to be perfect, T-Shirt sizing could work if we have well defined boundaries for that. Definitely worth exploring if there is any correlation between the build products and the archive size. I'm sure we could write a script which runs |
Beta Was this translation helpful? Give feedback.
-
Echoing what @finestructure says here, we want to be very careful with significantly increasing the load on our build machines. We have just had an injection of fresh hardware which has allowed us to catch up with builds again and we're in a good place right now, but we should approach additional significant processing tasks cautiously! I still like the idea, but we'll be cautious when adding features that take large amounts of processing time. Managing the service when it's struggling can be challenging. |
Beta Was this translation helpful? Give feedback.
-
Definitely understand and agree with yours and @finestructure points. I don't know what would be the minimum accuracy of binary size report you'd see as satisfactory, but surely a good analyzes of tradeoff between precision and performance is important here.
Yep, I'd up for it, @Sherlouk. Yesterday I was doing some quick tests here, and I'm not sure yet how precise it would be.
It seems that reading the content for Another thing I don't know is if both The archiving strategy is a bit simpler, since it's based on the package contents size of the generated application product, which contains the framework/package content "embedded" into it. |
Beta Was this translation helpful? Give feedback.
-
Moving this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hey @finestructure and @daveverwer 👋 Is binary size report still interesting to you? As we talked before, just as a quick recap, I guess the two main options would be:
If you are still interested I could take a look into the preferred option. Let me know if you have any thoughts. |
Beta Was this translation helpful? Give feedback.
-
Hello, I believe incorporating this metric would be beneficial. What are your thoughts on its feasibility now, @daveverwer and @finestructure? Do you think the potential gains outweigh the associated costs? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Today a new package has been added to SPI that promises to report the binary size impact of any package into the final product binary.
I believe it would be very cool/useful if SPI itself could display this size 😃:
for example this would prevent surprises when shipping an app update to the store!
Just a thought:
I'm sure there are challenges in adding such feature, thank you for your consideration 🙏🏻
Here are a few packages that offer this functionality
Beta Was this translation helpful? Give feedback.
All reactions