Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

5.2.3f1 Binary size increase

Discussion in 'iOS and tvOS' started by CPXTom, Dec 1, 2015.

  1. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    I was just getting ready to upload a build to apple and I noticed that our build size increased from our previous upload. I went back to 5.2.2f1 and did a build, the size was the same as our previous upload. In total it increased the size of our binary file (inside the archive) by 15mb, which increased our ipa size by about 7mb. For us this is very important as our app size was already near the 100mb limit, this will bring it over for sure.

    Since we can't wait for this to be fixed, we will use 5.2.2, but we would like to see this fixed :) Thanks!
     
  2. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    There is a report Android suffers same issues: http://forum.unity3d.com/threads/5-3f1-works-nice-but-made-my-apk-52mb-when-it-was-only-32mb.368352/

    Now the IL2CPP is trying to reduce size of the builds, just annoying that Unity do not check for these issues and often the users who have to report such findings in each build version.

    I just hope they manage sort this all in the end, whole point trying to reduce build size not increase, we see what version 5.3 brings..
     
    CPXTom likes this.
  3. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @CPXTom

    Do you know where the size went? For example, was 15 MB increase in the binary file due to code or data in the binary? If possible, can we have a look at your project to see where the size increase happened?

    For IL2CPP we do test real-world projects for code size, to try to avoid regressing in size. However, there are a number of different things that go into the package, so it may be an issue outside of IL2CPP. Still, I would love to have a look.
     
  4. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Thats excellent news, and restores my confidence. Keep up the work with this..
     
  5. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    @JoshPeterson
    I notice when I build with 5.2.3f1 it has to compile more files than 5.2.2f1. 392 files for 5.2.3f1 and 356 files for 5.2.2f1.

    Here's the other info:
    __TEXT for 5.2.2f1: 59.06mb
    __DATA for 5.2.2f1: 7.09mb

    __TEXT for 5.2.3f1: 71.92mb
    __DATA for 5.2.3f1: 7.36mb

    Looks like code and data both went up, but clearly the culprit here is the code segment. I'll see if I can get you a copy of the project, should I just submit a bug and attach the project?
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @CPXTom

    Wow, this is a pretty unexpected jump. Maybe something in managed code stripping changed, and more managed code is being included (hence more source files).

    If you can submit a bug report with the project that will be the best route for us to investigate. I definitely want to have a look at this. Thanks!
     
  7. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    @JoshPeterson
    submitted a bug with the project attached, here's the case's ticket: 749728_17qc7kvk2ol5co6j
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @CPXTom

    Excellent, thanks!
     
  9. sami_karilainen

    sami_karilainen

    Joined:
    Sep 11, 2015
    Posts:
    4
    We're having same issue, the binary size inside the IPA grew from 59.1MB (built with 5.2.1p2) to 72.8MB (5.2.2p4).

    I also tried with 5.2.3p2, and it too has binary size of 72.8MB.
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @sami_karilainen

    Thanks for the information. We will attempt to track down the cause of this issue. If you can submit your project with a bug report, that would help, as it will give us another data point to investigate.
     
  11. sami_karilainen

    sami_karilainen

    Joined:
    Sep 11, 2015
    Posts:
    4
    @JoshPeterson I just submitted a bug report with the project attached also. Didn't get confirmation mail yet but you can probably find the ticket with my name.
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    @sami_karilainen

    I can't immediately find the bug report. If you do get an email with the bug report number, please let me know the number. Thanks.
     
  13. sami_karilainen

    sami_karilainen

    Joined:
    Sep 11, 2015
    Posts:
    4
  14. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
  15. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    I wanted to provide a quick update on this issue. We've tracked down the cause of most of the size increase now. We're trying to get the fix in the next 5.2 patch release. It looks like the managed code stripping was not correctly stripping assemblies like mscorlib.dll, System.dll, etc.

    This fix does not account for all of the size increase though, so we'll continue to pursue this issue.
     
    BenouKat and CPXTom like this.
  16. CPXTom

    CPXTom

    Joined:
    Apr 24, 2010
    Posts:
    113
    Awesome! Good to hear :)
     
  17. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    I wanted to provide a brief post-mortem on this issue.

    We do have an existing test which attempts to prevent exactly this type of size regression due to a bug in managed code stripping. Unfortunately that test was written a few months ago, when the build size we shipped was much larger. In the meantime we have decreased the build size, but we did not adjust the expected size in that test, so the test continued to pass even after we regressed from 5.2.2 to 5.2.3.

    I've now updated the test to verify the latest (smaller) size. The test will now also fail if we get too small, so that we know to updated the expected size.

    Hopefully this change will prevent a similar regression in the future.

    Note also we we see a size increase from 5.2.2 to 5.2.3 which is unrelated to IL2CPP or generated code. Something in the native engine code is bigger than it was. We're working to track this down and understand it separately.
     
    CPXTom likes this.