Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Reduce binary size #8035

Closed
Closed

Description

@kkaefer

Looking at our binary size tracker, it looks like we got a massive increase on Feb 2/3, which seems to coincide with the merge of #7372. In some cases like Android arm-v7/8, the increase is as much as 1 MB. We should investigate ways of making the API leaner, and check whether there are certain templates that cause a huge amount of code to be generated.

/cc @jfirebaugh

Activity

  1. jfirebaugh commented on Feb 13, 2017

    @jfirebaugh
    Contributor

    Do you know of any tools for profiling binary size?

  2. kkaefer commented on Feb 14, 2017

    @kkaefer
    MemberAuthor

    There's https://github.com/google/bloaty, but I've found it to be of limited use since most (~80-90%) of the pie is typically attributed to [None]. Looking at the *.o files, any code that uses RapidJSON or the conversion headers seems to be quite heavy.

  3. jfirebaugh commented on Feb 21, 2017

    @jfirebaugh
    Contributor

    Looked into this on macOS and I can reproduce the ~500kb increase in Mapbox.framework between 6a6bddb and 22b3834. I have build directories for both of those commits, but I'm not sure how to identify why exactly the size increase occurs or how to reduce it. It looks like I'd have to start writing some custom tooling that does Mach-O binary reversing combined with analysis of the corresponding dSYM. (Apple's own Mach-O format documentation is now a 404.)

  4. added
    Core
    performance
    on Feb 22, 2017
  5. 1ec5 commented on Mar 4, 2017

    @1ec5
    Contributor

    Does this article have the Mach-O documentation you need?

  6. jfirebaugh commented on Mar 7, 2017

    @jfirebaugh
    Contributor

    Tried switching to mpark/variant, it was a pessimization:

         VM SIZE                               FILE SIZE
     ++++++++++++++ GROWING                 ++++++++++++++
      +481%  +163Ki __TEXT,__objc_methtype   +163Ki  +481%
      +1.7% +45.0Ki __TEXT,__text           +45.0Ki  +1.7%
      +157% +37.0Ki __DATA,__const          +37.0Ki  +157%
      +5.7% +16.4Ki __TEXT,__gcc_except_tab +16.4Ki  +5.7%
      +6.4% +10.3Ki [None]                  +11.6Ki  +6.8%
      +8.9% +5.84Ki __TEXT,__unwind_info    +5.84Ki  +8.9%
      +1.8% +1.92Ki __TEXT,__cstring        +1.92Ki  +1.8%
      +0.5%    +128 __DATA,__data              +128  +0.5%
    
     -------------- SHRINKING               --------------
      -0.1%    -288 __TEXT,__const             -288  -0.1%
      -0.6%     -16 __DATA,__bss                  0  [ = ]
      -0.1%      -8 __DATA,__objc_selrefs         0  [ = ]
    
      +7.7%  +280Ki TOTAL                    +281Ki  +7.7%
    
  7. jfirebaugh commented on Mar 8, 2017

    @jfirebaugh
    Contributor
  8. kkaefer commented on Mar 8, 2017

    @kkaefer
    MemberAuthor

    The code for this graph is at https://github.com/mapbox/mapbox-gl-native/tree/gh-pages. Our nightly builds pull data from CloudWatch and publish it to S3. The time period is currently limited to 30 days during the publishing process. The issue with collecting more data points at a single time is that the API will only give you back up to 1440 at a time. I just manually republished 60 days worth of data points and added a PR

  9. jfirebaugh commented on Mar 23, 2017

    @jfirebaugh
    Contributor

    Making some progress here, but it's also being offset by additional increases -- e.g. 20712b7 added 70k to the iOS/macOS binaries.

  10. added
    archived
    on Nov 11, 2018
  11. stale commented on Nov 26, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Corearchivedperformanceruntime styling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions