nightscout / Trio

Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations.
https://docs.diy-trio.org/en/latest/
MIT License
98 stars 526 forks source link

Xcode 16 Builds very slowly #423

Closed marionbarker closed 1 month ago

marionbarker commented 1 month ago

Describe the bug

Initial builds with Xcode 16 are significantly (many minutes) slower than with Xcode 15. This happens for a new clone and any time an existing clone is reset using Product->Clean Build folder.

Refer to Loop Issue for more details

Loop Issue 2235: Xcode 16 Builds very slowly

Trio Issue

Trio does not use all 6 of the submodules modified to solve the slow build issue for Loop. However, of the 4 affected modules that are used by Trio, the identical modification can be used.

These modules are:

As discussed in the Loop Issue, the settings for the ENABLE_MODULE_VERIFIER parameter were modified to be equal to a parameter set equal to not NO instead of hard coded to YES. Each module verification adds about 30 second to the initial build. For Trio, before the proposed modification for the 4 submodules, there were 8 modules verified in the 4 repositories.

Configuration

Build times reported in this Issue were obtained with

The Trio fixed test used a local modification to Trio dev.

Timing Test

The timing for the build is taken from the Xcode tool.

Note this does not include time to install the app or open the app on a phone or simulator.

Difference with respect to Loop

For those who read the Loop Issue in detail, you will notice that for Loop dev, the verify for the modules did not happen for the second build. This is not true for Trio dev.

Timing for dev and with the fix

Report build time in seconds for first, second and third builds in the table below.

Config Build # Time # Verify
Trio dev 1 370 8
Trio dev 2 195 5 or 6
Trio dev 3 8 0
Trio fixed 1 130 0
Trio fixed 2 12 0
Trio fixed 3 8 0

Timing Display for First Build: Trio dev

The graphic below shows and example timing display associated with the ENABLE_MODULE_VERIFIER = YES parameter for the first build for Trio dev after the clean build folder step.

timing-summary-trio-build-01

Timing Display for Second Build: Trio dev

The graphic below shows an example timing display associated with the ENABLE_MODULE_VERIFIER = YES parameter for the second build for Trio dev.

timing-summary-trio-build-02

Timing Display for First Build: Trio fix applied

The graphic below shows an example timing display for the initial build when the submodules have the suggested fix applied.

timing-summary-trio-fix-build-1