From 17371ecffc30fec2d0b3cc8afdf366ff65d2db6d Mon Sep 17 00:00:00 2001 From: Zhizhou Yang Date: Fri, 13 Oct 2017 11:42:13 -0700 Subject: [PATCH] Enable PGO for hwui This patch is trying to apply PGO for hwui. According to some research on PGO before, we got a 5% to 10% performance improvement with PGO on hwui and we hope to enable it. The patch specified a hwui.profdata file, which locates in internal google_data/pgo_profile directory, to work as the profile to feed PGO. This profdata can be re-collected through the PGO collecting script in the benchmark directory, and it was based on hwuimicro/hwuimacro benchmark for now. PGO can be turned of by setting ANDROID_PGO_NO_PROFILE_USE environment variable. Test: Build hwui successfully and verified the performance improvement on device through benchmark. Bug: http://b/63768402 Change-Id: Ib63e5504be34bdfe49f6bc2c52964c30c81f1416 --- libs/hwui/Android.bp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp index 124182f0336e7..ad6ce2c4a9d60 100644 --- a/libs/hwui/Android.bp +++ b/libs/hwui/Android.bp @@ -250,7 +250,17 @@ cc_library { // If enabled, every GLES call is wrapped & error checked // Has moderate overhead "hwui_enable_opengl_validation", -], + ], + + // Build libhwui with PGO by default. + // Location of PGO profile data is defined in build/soong/cc/pgo.go + // and is separate from hwui. + // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable. + pgo: { + instrumentation: true, + profile_file: "hwui/hwui.profdata", + benchmarks: ["hwui"], + }, } // ------------------------