From e18b77972b8e3eac2720429d2307cd40f1a23991 Mon Sep 17 00:00:00 2001 From: Zhizhou Yang Date: Mon, 11 Dec 2017 10:37:44 -0800 Subject: Turn on PGO for Skia on Android This patch is to turn on PGO for skia on Android, which will provide a performance improvement of 7.6% for hwui when applied PGO for both. The patch specified a skia.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 with PGO build system support. PGO can be turned off by setting ANDROID_PGO_NO_PROFILE_USE environment variable or set variable to false. Test: Build skia successfully and verified the performance improvement on device through benchmark. BUG=skia: Change-Id: I826f417569b2853630f6d4fcce236b5bc36547fa Reviewed-on: https://skia-review.googlesource.com/82880 Commit-Queue: Derek Sollenberger Reviewed-by: Derek Sollenberger Reviewed-by: John Reck --- gn/gn_to_bp.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'gn/gn_to_bp.py') diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index 3a1238bf20..a09e46ca66 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -91,7 +91,24 @@ cc_library_static { }, }, - defaults: ["skia_deps"], + defaults: ["skia_deps", + "skia_pgo", + ], +} + +// Build libskia with PGO by default. +// Location of PGO profile data is defined in build/soong/cc/pgo.go +// and is separate from skia. +// To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable +// or set enable_profile_use property to false. +cc_defaults { + name: "skia_pgo", + pgo: { + instrumentation: true, + profile_file: "skia/skia.profdata", + benchmarks: ["hwui", "skia"], + enable_profile_use: true, + }, } cc_defaults { -- cgit v1.2.3