Skip to content

Implement iOS app install deltas - #77756

Merged
fluttergithubbot merged 1 commit into
flutter:masterfrom
jmagman:app-deltas
Mar 10, 2021
Merged

fluttergithubbot merged 1 commit into
flutter:masterfrom
jmagman:app-deltas

Conversation

@jmagman

@jmagman jmagman commented Mar 10, 2021 •

Copy link
Copy Markdown
Member

Incremental iOS installs (app-deltas) are an Xcode feature exposed by ios-deploy in ios-control/ios-deploy#434 that saves a representation of the app to a place on disk, then only copies the deltas over when installing. Only implemented for BuildableIOSApp at build/ios/app-deltas, not PrebuiltIOSApp since I wasn't sure where the app deltas directory should live.

The app delta calculations are based on time stamp changes, not on file content hashes, so instead of deleting build/ios/iphoneos and copying the app bundle on every build, instead rsync the bundle so it only updates changed files, thus preserving the timestamps of unchanged files.

I ran some numbers (on my machine an an iPhone 6s) building and installing the new non-trivial gallery app after a flutter clean
The first number is the amount of time flutter run takes where I force an exit as soon as the app is launched. The second number is the same, run a second time with no clean.

stable master this PR
1st 1:15.08 1:14.95 1:17.53
2nd 48.379 45.479 31.096

So the improvements with thinning (#76834 and #77007), bitcode stripping (#77329), and codesigning (#77664) improved matters by ~3 seconds. App deltas gave us another ~14 seconds. It also cost us ~3 seconds on a first run, presumably to build the initial app-delta disk representation.

Note as long as flutter clean isn't run this will also be an improvement if any dart code changes and the App.framework needs to be recompiled, since the large Flutter.framework and plugin frameworks won't be copied over on subsequent installs.

BuildableIOSApp part of #67580.

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Mar 10, 2021
@jmagman jmagman self-assigned this Mar 10, 2021
@google-cla google-cla Bot added the cla: yes label Mar 10, 2021

@jonahwilliams jonahwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot
fluttergithubbot merged commit 08b225e into flutter:master Mar 10, 2021
@jmagman
jmagman deleted the app-deltas branch March 10, 2021 18:38
@jmagman

jmagman commented Mar 11, 2021

Copy link
Copy Markdown
Member Author

@anirudhb I would love to know if this feature is working for you, if you have any bandwidth. Please file any issues you see!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants