Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Add support for the Metal backend on all iOS builds. #17080

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

chinmaygarde
Copy link
Member

@chinmaygarde chinmaygarde commented Mar 10, 2020

Metal is not enabled by default yet. This commit will increase the size of the
iOS engine binary. A breakdown of the increase is as follows:

Both binaries are Mach-O 64-bit dynamically linked shared library of type arm64.
For reproduction, these numbers were gathered at Engine hash
01a52b9.

  • Uncompressed Metal iOS Engine Version: 11380 KB
  • Uncompressed Non-Metal iOS: 11128 KB

Detailed breakdown of size differences:

     VM SIZE                                FILE SIZE
 --------------                          --------------
  +2.0%  +106Ki __TEXT,__text             +106Ki  +2.0%
  +2.6% +70.9Ki String Table             +70.9Ki  +2.6%
  +2.3% +35.5Ki Symbol Table             +35.5Ki  +2.3%
  +171% +8.32Ki [__DATA]                 +8.32Ki +13e3%
  +2.3% +6.48Ki __TEXT,__cstring         +6.48Ki  +2.3%
  +2.3% +6.12Ki __DATA,__const           +6.12Ki  +2.3%
   +23% +4.67Ki [__TEXT]                 +4.67Ki   +23%
  +109% +4.06Ki __TEXT,__gcc_except_tab  +4.06Ki  +109%
   +38% +3.98Ki [__LINKEDIT]                   0  [ = ]
   +18% +3.40Ki __TEXT,__objc_methname   +3.40Ki   +18%
  +3.5% +1.64Ki __TEXT,__unwind_info     +1.64Ki  +3.5%
   +23% +1.12Ki __DATA,__objc_selrefs    +1.12Ki   +23%
  +0.1%    +656 __TEXT,__const              +656  +0.1%
  +2.1%    +568 Function Start Addresses    +568  +2.1%
  +6.0%    +528 Binding Info                +528  +6.0%
  +2.1%    +320 Lazy Binding Info           +320  +2.1%
  +1.3%    +292 [5 Others]                  +292  +1.3%
  +4.5%    +288 __DATA,__cfstring           +288  +4.5%
  +3.8%    +160 [Mach-O Headers]            +160  +3.8%
  +1.2%    +136 Rebase Info                 +136  +1.2%
   +12%     +88 __DATA,__objc_classrefs      +88   +12%
  +2.3%  +256Ki TOTAL                     +252Ki  +2.3%

Fixes flutter/flutter#52369

Metal is not enabled by default yet. This commit will increase the size of the
iOS engine binary. A breakdown of the increase is as follows:

Both binaries are Mach-O 64-bit dynamically linked shared library of type arm64.
For reproduction, these numbers were gathers at Engine hash
01a52b9.

* Uncompressed Metal iOS Engine Version: 11380 KB
* Uncompressed Non-Metal iOS
* Engine Version: 11128 KB

Detailed breakdown of size differences:
```
     VM SIZE                                FILE SIZE
 --------------                          --------------
  +2.0%  +106Ki __TEXT,__text             +106Ki  +2.0%
  +2.6% +70.9Ki String Table             +70.9Ki  +2.6%
  +2.3% +35.5Ki Symbol Table             +35.5Ki  +2.3%
  +171% +8.32Ki [__DATA]                 +8.32Ki +13e3%
  +2.3% +6.48Ki __TEXT,__cstring         +6.48Ki  +2.3%
  +2.3% +6.12Ki __DATA,__const           +6.12Ki  +2.3%
   +23% +4.67Ki [__TEXT]                 +4.67Ki   +23%
  +109% +4.06Ki __TEXT,__gcc_except_tab  +4.06Ki  +109%
   +38% +3.98Ki [__LINKEDIT]                   0  [ = ]
   +18% +3.40Ki __TEXT,__objc_methname   +3.40Ki   +18%
  +3.5% +1.64Ki __TEXT,__unwind_info     +1.64Ki  +3.5%
   +23% +1.12Ki __DATA,__objc_selrefs    +1.12Ki   +23%
  +0.1%    +656 __TEXT,__const              +656  +0.1%
  +2.1%    +568 Function Start Addresses    +568  +2.1%
  +6.0%    +528 Binding Info                +528  +6.0%
  +2.1%    +320 Lazy Binding Info           +320  +2.1%
  +1.3%    +292 [5 Others]                  +292  +1.3%
  +4.5%    +288 __DATA,__cfstring           +288  +4.5%
  +3.8%    +160 [Mach-O Headers]            +160  +3.8%
  +1.2%    +136 Rebase Info                 +136  +1.2%
   +12%     +88 __DATA,__objc_classrefs      +88   +12%
  +2.3%  +256Ki TOTAL                     +252Ki  +2.3%
```

Fixes flutter/flutter#52369
@chinmaygarde
Copy link
Member Author

https://chromium-review.googlesource.com/c/chromium/tools/build/+/2097397 needs to land before this so that LUCI doesn't end up trying to build a variant that does not exist.

@chinmaygarde
Copy link
Member Author

The recipe update has landed.

@chinmaygarde chinmaygarde added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Mar 11, 2020
@fluttergithubbot fluttergithubbot merged commit e8e0e0b into flutter:master Mar 11, 2020
@chinmaygarde chinmaygarde deleted the unified_builds branch March 11, 2020 02:56
chinmaygarde added a commit that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 11, 2020
jason-simmons added a commit to jason-simmons/flutter that referenced this pull request Mar 11, 2020
2020-03-11 [email protected] Roll src/third_party/dart 4093d08271f6..37530145ff53 (4 commits) (flutter/engine#17090)
2020-03-11 [email protected] Roll src/third_party/skia bf355123ae3b..0340292972b9 (9 commits) (flutter/engine#17089)
2020-03-11 [email protected] Roll fuchsia/sdk/core/mac-amd64 from r_oCI... to 0Z8VF... (flutter/engine#17087)
2020-03-11 [email protected] Roll fuchsia/sdk/core/linux-amd64 from v32mJ... to X3Xm2... (flutter/engine#17086)
2020-03-11 [email protected] Remove the unused method on iOS surface to make the resource context current. (flutter/engine#17084)
2020-03-11 [email protected] Revert "Add support for the Metal backend on all iOS builds. (flutter#17080)" (flutter/engine#17088)
2020-03-11 [email protected] Roll src/third_party/dart ace1d9b9213a..4093d08271f6 (12 commits) (flutter/engine#17082)
2020-03-11 [email protected] Add support for the Metal backend on all iOS builds. (flutter/engine#17080)
2020-03-11 [email protected] Roll src/third_party/skia d3f67dbf9f36..bf355123ae3b (9 commits) (flutter/engine#17079)
2020-03-11 [email protected] Disable Embedder11yTest::A11yTreeIsConsistent to unblock LUCI. (flutter/engine#17081)
2020-03-10 [email protected] Gather demangled stack traces and report the same to console on crashes. (flutter/engine#16450)
2020-03-10 [email protected] Implement asynchronous texture uploads when using the Metal backend on iOS. (flutter/engine#17046)
2020-03-10 [email protected] Roll src/third_party/dart 97674262bc29..ace1d9b9213a (14 commits) (flutter/engine#17078)
2020-03-10 [email protected] Add RTree to flow (flutter/engine#16923)
2020-03-10 [email protected] Roll src/third_party/skia 78dac6dcb222..d3f67dbf9f36 (6 commits) (flutter/engine#17072)
2020-03-10 [email protected] Revert "Fix bounds of image_filter_layer (flutter#16960)" (flutter/engine#17074)
2020-03-10 [email protected] Use the ELF loader to setup AOT symbols in benchmark runner. (flutter/engine#17051)
2020-03-10 [email protected] Roll src/third_party/skia 23899c64e3db..78dac6dcb222 (19 commits) (flutter/engine#17069)
2020-03-10 [email protected] Roll dart to 97674262bc29447dc59d5c93024b18b27d4bcf98. (flutter/engine#17067)
2020-03-10 [email protected] [web] Fixes for Firefox & Safari double underline decoration bugs. (flutter/engine#16994)
2020-03-10 [email protected] Avoid capturing this unsafely in MultiFrameCodec (flutter/engine#16824)
2020-03-10 [email protected] Revert "Revert "fix shadows and mask filter blurs (flutter#16963)" (flutter#17008)" (flutter/engine#17040)
2020-03-10 [email protected] Add support for firefox mac installer. Update web_ui pubspec for http.wq (flutter/engine#17044)
2020-03-09 [email protected] fix "TREE INCONSISTENT" noise in compositing_test.dart (flutter/engine#16995)
2020-03-09 [email protected] Add more child lifecycle tests (flutter/engine#16689)
2020-03-09 [email protected] Add libfreetype6-dev to desktop Linux dependencies (flutter/engine#17020)
2020-03-09 [email protected] Disable shell benchmarks (flutter/engine#17038)
2020-03-09 [email protected] Fix bounds of image_filter_layer (flutter/engine#16960)
2020-03-09 [email protected] Record fml and shell benchmarks (flutter/engine#16991)
2020-03-09 [email protected] Roll src/third_party/skia c56950442dd1..23899c64e3db (11 commits) (flutter/engine#17033)
2020-03-09 [email protected] use commit date instead of author date (flutter/engine#17032)
jason-simmons added a commit to flutter/flutter that referenced this pull request Mar 11, 2020
2020-03-11 [email protected] Roll src/third_party/dart 4093d08271f6..37530145ff53 (4 commits) (flutter/engine#17090)
2020-03-11 [email protected] Roll src/third_party/skia bf355123ae3b..0340292972b9 (9 commits) (flutter/engine#17089)
2020-03-11 [email protected] Roll fuchsia/sdk/core/mac-amd64 from r_oCI... to 0Z8VF... (flutter/engine#17087)
2020-03-11 [email protected] Roll fuchsia/sdk/core/linux-amd64 from v32mJ... to X3Xm2... (flutter/engine#17086)
2020-03-11 [email protected] Remove the unused method on iOS surface to make the resource context current. (flutter/engine#17084)
2020-03-11 [email protected] Revert "Add support for the Metal backend on all iOS builds. (#17080)" (flutter/engine#17088)
2020-03-11 [email protected] Roll src/third_party/dart ace1d9b9213a..4093d08271f6 (12 commits) (flutter/engine#17082)
2020-03-11 [email protected] Add support for the Metal backend on all iOS builds. (flutter/engine#17080)
2020-03-11 [email protected] Roll src/third_party/skia d3f67dbf9f36..bf355123ae3b (9 commits) (flutter/engine#17079)
2020-03-11 [email protected] Disable Embedder11yTest::A11yTreeIsConsistent to unblock LUCI. (flutter/engine#17081)
2020-03-10 [email protected] Gather demangled stack traces and report the same to console on crashes. (flutter/engine#16450)
2020-03-10 [email protected] Implement asynchronous texture uploads when using the Metal backend on iOS. (flutter/engine#17046)
2020-03-10 [email protected] Roll src/third_party/dart 97674262bc29..ace1d9b9213a (14 commits) (flutter/engine#17078)
2020-03-10 [email protected] Add RTree to flow (flutter/engine#16923)
2020-03-10 [email protected] Roll src/third_party/skia 78dac6dcb222..d3f67dbf9f36 (6 commits) (flutter/engine#17072)
2020-03-10 [email protected] Revert "Fix bounds of image_filter_layer (#16960)" (flutter/engine#17074)
2020-03-10 [email protected] Use the ELF loader to setup AOT symbols in benchmark runner. (flutter/engine#17051)
2020-03-10 [email protected] Roll src/third_party/skia 23899c64e3db..78dac6dcb222 (19 commits) (flutter/engine#17069)
2020-03-10 [email protected] Roll dart to 97674262bc29447dc59d5c93024b18b27d4bcf98. (flutter/engine#17067)
2020-03-10 [email protected] [web] Fixes for Firefox & Safari double underline decoration bugs. (flutter/engine#16994)
2020-03-10 [email protected] Avoid capturing this unsafely in MultiFrameCodec (flutter/engine#16824)
2020-03-10 [email protected] Revert "Revert "fix shadows and mask filter blurs (#16963)" (#17008)" (flutter/engine#17040)
2020-03-10 [email protected] Add support for firefox mac installer. Update web_ui pubspec for http.wq (flutter/engine#17044)
2020-03-09 [email protected] fix "TREE INCONSISTENT" noise in compositing_test.dart (flutter/engine#16995)
2020-03-09 [email protected] Add more child lifecycle tests (flutter/engine#16689)
2020-03-09 [email protected] Add libfreetype6-dev to desktop Linux dependencies (flutter/engine#17020)
2020-03-09 [email protected] Disable shell benchmarks (flutter/engine#17038)
2020-03-09 [email protected] Fix bounds of image_filter_layer (flutter/engine#16960)
2020-03-09 [email protected] Record fml and shell benchmarks (flutter/engine#16991)
2020-03-09 [email protected] Roll src/third_party/skia c56950442dd1..23899c64e3db (11 commits) (flutter/engine#17033)
2020-03-09 [email protected] use commit date instead of author date (flutter/engine#17032)
@hy9be
Copy link

hy9be commented Nov 13, 2022

This may not be the right thread but I wonder if anyone plans to update the statement Incremental reductions to this size will continue to be made but a significant reduction requires the removal of the OpenGL backend. This is not something we have considered yet. in the wiki page https://github.com/flutter/flutter/wiki/Metal-on-iOS-FAQ, after #37448 is merged. Thanks.

@chinmaygarde
Copy link
Member Author

You're right, I filed flutter/flutter#115243 to address this. IMO, we should just remove the entry.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable unified Metal/OpenGL iOS builds.
7 participants