Commit 9d395e1d authored by Pavel Iliin's avatar Pavel Iliin Committed by Commit Bot

Optimize for speed Android performance sensitive functions.

Set optimize_max compiler options to build some hot blink render
components and improve size-vs-speed balance on Android.

Pixel4 Aarch32/64:
+628Kb/+884Kb libchrome size
+6.9%/+5.7% speedometer2 speed

Bug: 1125115

Binary-Size: Will revert this after perf graphs show impact of it.
Change-Id: I45e176ae1cbc2e513eda986b667ce65640ec9a2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390778
Commit-Queue: Pavel Iliin <Pavel.Iliin@arm.com>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804555}
parent 5c30dee8
...@@ -276,6 +276,11 @@ blink_core_sources("animation") { ...@@ -276,6 +276,11 @@ blink_core_sources("animation") {
"worklet_animation_controller.h", "worklet_animation_controller.h",
] ]
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
deps = [ ":buildflags" ] deps = [ ":buildflags" ]
} }
......
...@@ -593,6 +593,10 @@ blink_core_sources("css") { ...@@ -593,6 +593,10 @@ blink_core_sources("css") {
"vision_deficiency.h", "vision_deficiency.h",
"zoom_adjusted_pixel_value.h", "zoom_adjusted_pixel_value.h",
] ]
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
} }
blink_core_tests("unit_tests") { blink_core_tests("unit_tests") {
......
...@@ -309,6 +309,13 @@ blink_core_sources("dom") { ...@@ -309,6 +309,13 @@ blink_core_sources("dom") {
"xml_document.h", "xml_document.h",
] ]
# TODO(pavel.iliin) hot path functions separtion into "dom_hotpath" is not
# required anymore. Combine them with "dom" sources.
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
public_deps = [ public_deps = [
"//third_party/blink/public/mojom:mojom_core_blink", "//third_party/blink/public/mojom:mojom_core_blink",
......
...@@ -223,6 +223,11 @@ blink_core_sources("frame") { ...@@ -223,6 +223,11 @@ blink_core_sources("frame") {
"window_or_worker_global_scope.h", "window_or_worker_global_scope.h",
] ]
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
deps = [ deps = [
"//skia", "//skia",
"//ui/accessibility:ax_base", "//ui/accessibility:ax_base",
......
...@@ -598,6 +598,11 @@ blink_core_sources("html") { ...@@ -598,6 +598,11 @@ blink_core_sources("html") {
"window_name_collection.h", "window_name_collection.h",
] ]
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
deps = [ deps = [
"//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:metrics_cpp",
"//skia:skcms", "//skia:skcms",
......
...@@ -648,6 +648,11 @@ blink_core_sources("layout") { ...@@ -648,6 +648,11 @@ blink_core_sources("layout") {
] ]
} }
if (is_android && !is_debug) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
if (is_fuchsia) { if (is_fuchsia) {
sources += [ "layout_theme_fuchsia.cc" ] sources += [ "layout_theme_fuchsia.cc" ]
} }
......
...@@ -265,4 +265,8 @@ blink_core_sources("paint") { ...@@ -265,4 +265,8 @@ blink_core_sources("paint") {
"view_painter.cc", "view_painter.cc",
"view_painter.h", "view_painter.h",
] ]
if (!is_debug && is_android) {
configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ]
}
} }
...@@ -113,7 +113,7 @@ blink_platform_sources("heap") { ...@@ -113,7 +113,7 @@ blink_platform_sources("heap") {
"//v8", "//v8",
] ]
if (!is_debug && !optimize_for_size) { if (!is_debug && (!optimize_for_size || is_android)) {
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
} }
......
...@@ -242,7 +242,7 @@ component("wtf") { ...@@ -242,7 +242,7 @@ component("wtf") {
sources -= [ "text/atomic_string_cf.cc" ] sources -= [ "text/atomic_string_cf.cc" ]
} }
if (!is_debug && !optimize_for_size) { if (!is_debug && (!optimize_for_size || is_android)) {
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment