Skip to content

Conversation

m0hamed
Copy link

@m0hamed m0hamed commented Nov 2, 2017

If tracing is disabled, instead of using hb_auto_trace_t<0, ret_t>, a
new struct is used instead hb_no_trace<ret_t>. Using the simpler struct
reduces the binary size for release builds by removing unneaded debug
code.

These are the results of the difference (from chromium build with and without patch):
Section Sizes (Total=-101kb (-103544 bytes)):
.bss: 0 bytes (0 bytes) (not included in totals)
.data: 0 bytes (0 bytes) (-0.0%)
.data.rel.ro: 0 bytes (0 bytes) (-0.0%)
.rel.dyn: 0 bytes (0 bytes) (-0.0%)
.rodata: -73.5kb (-75264 bytes) (72.7%)
.text: -27.6kb (-28280 bytes) (27.3%)

MonochromePublic.apk_Breakdown (-106,496 bytes)
+2 bytes Zip Overhead
-106,496 bytes Native code size
-2 bytes Package metadata size
MonochromePublic.apk_Specifics
-106,496 bytes normalized apk size
-106,496 bytes main lib size

For reference the compiled library size in full is 247,609 bytes, in the chrome for android apk.

If tracing is disabled, instead of using hb_auto_trace_t<0, ret_t>, a
new struct is used instead hb_no_trace<ret_t>. Using the simpler struct
reduces the binary size for release builds by removing unneaded debug
code.
@m0hamed
Copy link
Author

m0hamed commented Nov 3, 2017

Here is the chromium bug about the issue.

@behdad
Copy link
Member

behdad commented Nov 3, 2017

Thanks Mohamed. We noticed this independently as well, but only on Android with clang. To me, this looks like a clang bug. I'll comment in the Chromium bug.

behdad added a commit that referenced this pull request Nov 3, 2017
@behdad behdad closed this in 5aad819 Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants