Skip to content
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

[HOLD for payment 2024-11-05] [$250] [HOLD for payment 2024-10-24] Speed up iOS builds #50252

Closed
roryabraham opened this issue Oct 4, 2024 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Oct 4, 2024

Coming off the hype train over in #49567

Problem

iOS builds take about 10 minutes for me on my M2 Mac

Solution

Investigate ways to speedup iOS builds.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849043155218614009
  • Upwork Job ID: 1849043155218614009
  • Last Price Increase: 2024-10-23
Issue OwnerCurrent Issue Owner: @
@roryabraham
Copy link
Contributor Author

@Julesssss hopefully it's not too presumptive of me to assign you as babysitter.

@TMisiukiewicz @gedu et. all are going to look into this

@Julesssss
Copy link
Contributor

Excellent, look forward to the investigation!

@TMisiukiewicz
Copy link
Contributor

Hey, some of my first findings here:

  1. For each development build we are including debug symbols for symbolicating stack traces, which is useful when analyzing crash logs. However, seems like it is only relevant for release builds to track crashes in production apps. I think we can disable it for development builds - it saves 10-20 seconds on each build for me.
  2. Since we don't use Fullstory in debug mode, we can exclude "Run Fullstory Asset Uploader" from builds running on simulator - for me it's 5s improvement on each build. I think we could possibly skip Fullstory in development builds entirely to speed it up even more (just like on Android), however I am not sure how to do this properly since iOS SDK does not expose anything to do that. I need more investigation around it.

Some other stuff I tried:

  1. Playing around Optimization Level - it's currently hard to say for me about any results, needs more investigation
  2. Enabling ccache - my builds starts to fail, needs more investigation - might be related with too aggresive optimization level

Another thing i noticed was pretty high time of execution of custom shell script for copying xcframework GoogleAppMeasurement. (screen below). The problem is, this is happening for me only from time to time during the builds, so I am not sure if its impact on the build time is big. Anyway, it's a dependency of Firebase/Analytics and if I understand correctly, it is necessary when using ads in the app. It can be excluded by setting $RNFirebaseAnalyticsWithoutAdIdSupport = true in Podfile, then it's not used in a build anymore. Might be some caching issue on my side, so maybe it's worth building the app in xcode a few times by someone who haven't done any optimization tweaks before to confirm that.

image

@TMisiukiewicz
Copy link
Contributor

TMisiukiewicz commented Oct 11, 2024

Opened first PR excluding uploading assets to Fullstory in development #50633. It should save 30-50s on each build

@TMisiukiewicz
Copy link
Contributor

Also opened #50634 to skip generating dSYM in development builds. For me it saves 8-15 seconds on each build.

With this 2 PRs, my cached builds went down from ~42s to ~15s. Also saves 30-60seconds for clean builds.

@TMisiukiewicz
Copy link
Contributor

Tried one more thing today: passing --jobs param to xcodebuild. It specifies the maximum number of concurrent build operations. It defaults to amount of cores + 1 (so in my case it's 8+1). I increased it to 12, but haven't seen any improvement in build time, the average times for default and custom value were pretty similar

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 17, 2024
@melvin-bot melvin-bot bot changed the title Speed up iOS builds [HOLD for payment 2024-10-24] Speed up iOS builds Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.49-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-10-24. 🎊

@shubham1206agra
Copy link
Contributor

@roryabraham Please assign me here as reviewer

@Julesssss
Copy link
Contributor

Hey @shubham1206agra I'll handle this as Rory is away.

@Julesssss Julesssss added the External Added to denote the issue can be worked on by a contributor label Oct 23, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-24] Speed up iOS builds [$250] [HOLD for payment 2024-10-24] Speed up iOS builds Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021849043155218614009

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 23, 2024
@Julesssss Julesssss added Bug Something is broken. Auto assigns a BugZero manager. and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@Julesssss Julesssss removed the Bug Something is broken. Auto assigns a BugZero manager. label Oct 23, 2024
@Julesssss
Copy link
Contributor

Hey @sakluger, assigning you for the payout which is due tomorrow

@sakluger
Copy link
Contributor

Summarizing payment on this issue:

Contributor: @TMisiukiewicz - No payment due, contractor
Contributor+: @shubham1206agra $250, sent Upwork offer: https://www.upwork.com/nx/wm/offer/104560053

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Oct 23, 2024
@shubham1206agra
Copy link
Contributor

@sakluger Offer accepted

@sakluger
Copy link
Contributor

Thanks! All paid.

Copy link

melvin-bot bot commented Oct 24, 2024

@sakluger @Julesssss Be sure to fill out the Contact List!

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Oct 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] [HOLD for payment 2024-10-24] Speed up iOS builds [HOLD for payment 2024-11-05] [$250] [HOLD for payment 2024-10-24] Speed up iOS builds Oct 29, 2024
Copy link

melvin-bot bot commented Oct 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.54-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-05. 🎊

For reference, here are some details about the assignees on this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

5 participants