(In reply to :dmajor from comment #19) > (In reply to Andrew Creskey from comment #17) > > If you can help me with a patch for Android I would be very happy to see how it performs and the resulting binary size. > > I believe this patch ought to do it: https://hg.mozilla.org/try/rev/c37802d5c0ac94a41de9fb3116ce1aa403c27d5d > > However, although that patch got impressive wins on Windows and Linux, it only saved a few hundred KB on Android, and only a few hundred KB more when I further lowered the limit to 5. I'm puzzled by why Android behaves so differently. dmajor, when I add your `-import-instr-limit=10` option to the `-O2` build I'm seeing **very** significant size savings. Perhaps without the higher level optimizations there weren't that many long functions being imported? `libxul.so` for arm32 goes from `84.9MB` to to `79.1MB` `libxul.so` for aarch64 goes from `123.1MB` to to `112.9MB` [Your patch with `-O2`](https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=273791498&revision=92b9a27ff74e0df3f10d952a733b8481b8e97869) [`-O2`](https://treeherder.mozilla.org/#/jobs?repo=try&revision=1cdf2f07a42962881e41bd3f814bfb3283d576b2&selectedJob=273881096) So updated APK sizes are: ``` Optimization AArch Size, MB -Oz 32 44.0 -O2,instr-limit=10 32 50.9 -O2 32 53.7 -O3 32 54.9 -Oz 64 50.2 -O2,instr-limit=10 64 57.0 -O2 64 60.9 -O3 64 62.6 ``` `-O2,instr-limit=10` looks to have roughly have the size-penalty of `-O3`, so I'll retitle this bug. [Performance of `O2, instr-limit=10`against mozilla-central still looks great.](https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&newProject=try&newRevision=92b9a27ff74e0df3f10d952a733b8481b8e97869&framework=10&selectedTimeRange=172800)
Bug 1591725 Comment 21 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to :dmajor from comment #19) > (In reply to Andrew Creskey from comment #17) > > If you can help me with a patch for Android I would be very happy to see how it performs and the resulting binary size. > > I believe this patch ought to do it: https://hg.mozilla.org/try/rev/c37802d5c0ac94a41de9fb3116ce1aa403c27d5d > > However, although that patch got impressive wins on Windows and Linux, it only saved a few hundred KB on Android, and only a few hundred KB more when I further lowered the limit to 5. I'm puzzled by why Android behaves so differently. dmajor, when I add your `-import-instr-limit=10` option to the `-O2` build I'm seeing **very** significant size savings. Perhaps without the higher level optimizations there weren't that many long functions being imported? `libxul.so` for arm32 goes from `84.9MB` to to `79.1MB` `libxul.so` for aarch64 goes from `123.1MB` to to `112.9MB` [Your patch with `-O2`](https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=273791498&revision=92b9a27ff74e0df3f10d952a733b8481b8e97869) [`-O2`](https://treeherder.mozilla.org/#/jobs?repo=try&revision=1cdf2f07a42962881e41bd3f814bfb3283d576b2&selectedJob=273881096) So updated APK sizes are: ``` Optimization AArch Size, MB -Oz 32 44.0 -O2,instr-limit=10 32 50.9 -O2 32 53.7 -O3 32 54.9 -Oz 64 50.7 -O2,instr-limit=10 64 57.0 -O2 64 60.9 -O3 64 62.6 ``` `-O2,instr-limit=10` looks to have roughly have the size-penalty of `-O3`, so I'll retitle this bug. [Performance of `O2, instr-limit=10`against mozilla-central still looks great.](https://treeherder.mozilla.org/perf.html#/compare?originalProject=mozilla-central&newProject=try&newRevision=92b9a27ff74e0df3f10d952a733b8481b8e97869&framework=10&selectedTimeRange=172800)