Simplify tracing code when tracing is disabled. #605
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.