diff options
| author | 2018-02-26 17:59:38 -0800 | |
|---|---|---|
| committer | 2018-03-01 11:21:30 -0800 | |
| commit | f30f112da0464edcf95948a3c503c0ac4a3122fc (patch) | |
| tree | 0fa6528b88f47bc96d5dedcd72fb1b3a4786be96 | |
| parent | d7391be00415cb54990de7f82d682ad8721122d3 (diff) | |
Enable ThinLTO for hwui
ThinLTO will benefit hwui on both performance and code size.
Now that hwui is with PGO, ThinLTO provides 3.8% performance improvement
on top of it (tested using hwui benchmarks on marlin device).
Enabling ThinLTO also decreases current code size of libhwui.so by 3.2%.
To be mentioned, Thinlto property in bp file will go through all static
libraries that hwui depends on (such as libskia) and enable Thinlto for
them when building hwui.
Test: Build and run benchmarks with ThinLTO enabled.
Bug: http://b/62839002
Change-Id: I89466d50c3715f6e7b0518ff10240bf8a5e9714c
| -rw-r--r-- | libs/hwui/Android.bp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index 24d819e93ff2..35790b6558c7 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -6,6 +6,7 @@ cc_defaults { //"hwui_bugreport_font_cache_usage", //"hwui_compile_for_perf", "hwui_pgo", + "hwui_lto", ], cpp_std: "c++17", @@ -126,6 +127,18 @@ cc_defaults { }, } +// Build hwui library with ThinLTO by default. +cc_defaults { + name: "hwui_lto", + target: { + android: { + lto: { + thin: true, + }, + }, + }, +} + // ------------------------ // library // ------------------------ |