-
-
Notifications
You must be signed in to change notification settings - Fork 356
ci: parallelize xcframework slice builds #5218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
That would be super nice to get done. Thanks for starting this @armcknight. |
Got the slices all building in parallel, working on downloading the artifacts for assembly together. It's looking like the total job time will be around 5-6 minutes now based on https://github.com/getsentry/sentry-cocoa/actions/runs/15080146739 |
Fiiiiinally got all the things in the right path locations to get it all passing again. Final result: 6m17s. |
The only CI checks I validated were in the workflow build-xcframework.yml. The failing tests are due to having removed the old build-xcframework.sh script but not yet updating benchmarking.yml or ui-tests.yml to use the new reusable workflows that parallelize the steps from it; #5277 fixes that and should be merged into this branch before merging this one to |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e4cc043 | 1230.10 ms | 1254.36 ms | 24.26 ms |
103d817 | 1211.55 ms | 1213.35 ms | 1.80 ms |
983de17 | 1260.57 ms | 1263.68 ms | 3.11 ms |
e070f8a | 1236.47 ms | 1250.50 ms | 14.03 ms |
afce5bf | 1199.94 ms | 1213.27 ms | 13.33 ms |
b9b0f0a | 1257.22 ms | 1262.57 ms | 5.35 ms |
60bfc91 | 1251.29 ms | 1261.67 ms | 10.39 ms |
3fc6a6f | 1241.96 ms | 1254.13 ms | 12.17 ms |
6e625c5 | 1243.47 ms | 1243.58 ms | 0.11 ms |
2deb275 | 1228.20 ms | 1245.02 ms | 16.82 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
e4cc043 | 22.85 KiB | 414.92 KiB | 392.07 KiB |
103d817 | 21.58 KiB | 571.91 KiB | 550.33 KiB |
983de17 | 22.84 KiB | 403.19 KiB | 380.34 KiB |
e070f8a | 21.58 KiB | 546.20 KiB | 524.62 KiB |
afce5bf | 21.58 KiB | 542.18 KiB | 520.60 KiB |
b9b0f0a | 20.76 KiB | 434.94 KiB | 414.17 KiB |
60bfc91 | 20.76 KiB | 434.94 KiB | 414.18 KiB |
3fc6a6f | 22.30 KiB | 821.37 KiB | 799.07 KiB |
6e625c5 | 22.85 KiB | 413.41 KiB | 390.56 KiB |
2deb275 | 21.58 KiB | 681.72 KiB | 660.14 KiB |
Previous results on branch: armcknight/ci/parallelize-xcframework-build
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
df6b0fb | 1228.02 ms | 1262.15 ms | 34.12 ms |
561986c | 1207.55 ms | 1228.81 ms | 21.26 ms |
7865e6e | 1233.12 ms | 1255.29 ms | 22.16 ms |
ff09fb1 | 1222.22 ms | 1251.30 ms | 29.07 ms |
cd452df | 1229.82 ms | 1254.49 ms | 24.67 ms |
abb8f1a | 1232.08 ms | 1245.48 ms | 13.40 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
df6b0fb | 23.75 KiB | 840.53 KiB | 816.78 KiB |
561986c | 23.76 KiB | 824.89 KiB | 801.13 KiB |
7865e6e | 23.75 KiB | 843.50 KiB | 819.75 KiB |
ff09fb1 | 23.75 KiB | 844.04 KiB | 820.29 KiB |
cd452df | 23.76 KiB | 824.89 KiB | 801.13 KiB |
abb8f1a | 23.76 KiB | 824.89 KiB | 801.13 KiB |
fee2b24
to
f928af0
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5218 +/- ##
=============================================
- Coverage 86.061% 86.031% -0.031%
=============================================
Files 397 397
Lines 34588 34592 +4
Branches 14990 14988 -2
=============================================
- Hits 29767 29760 -7
- Misses 4777 4790 +13
+ Partials 44 42 -2 see 13 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
We looked at the difference in the macosx slice's size and discovered that the upload artifact action zips up the files and in the process resolves symlinks, so was duplicating things. We are instead ditto-ing the files before uploading them. |
Fixed the remaining symlink issues. Manually tested Sentry-Dynamic, Sentry (static) and SentrySwiftUI in a test project for each platform, including mac catalyst. |
Also I realized that now that |
i've locally validated with the integration tests in #5384 that each kind of app and package manager can correctly link each type of SDK variant. |
The job to build the xcframework builds all the slices in serial, which takes upwards of 30 minutes. There are at least 6 slices, so if we parallelize these, we should be able to cut that time down to a small fraction.
Before: 30 minutes 52 seconds
After: 6 minutes 17 seconds
One thing I noticed but haven't yet addressed is that the SentrySwiftUI build actually produced Sentry.xcframework as well, because to archive the SentrySwiftUI target, Sentry target must be built as well as it's a dependency. So, we could avoid the duplicated tasks with some tweaks to the workflow logic. I just haven't figured out how to do that yet.
Another future task could be caching individual slices and assembled variants, as not all will always need to be rebuilt (think, if uikit code is modified, then the UIKitless variant won't need to be rebuilt).
#skip-changelog
Fixes GH-4925