Commit c2bb3798 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Remove -fprofile-sample-accurate from blink core

This trades off some size for performance.

Binary-Size: Trading size for speed
Bug: 1125115
Change-Id: If18e8ef4449dec6aab4494fa7d04063d8d94b845
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491540Reviewed-by: default avatarGeorge Burgess <gbiv@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819964}
parent 5bb4cf70
...@@ -321,7 +321,7 @@ blink_core_sources("core_hot") { ...@@ -321,7 +321,7 @@ blink_core_sources("core_hot") {
# TODO(ajwong) this is of mirror # TODO(ajwong) this is of mirror
# https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/core.gni;l=26 # https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/core.gni;l=26
# to undo the configs which is fragile. Find a better way. # to undo the configs which is fragile. Find a better way.
if (is_android && !is_debug) { if (!is_debug && optimize_for_size) {
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
} }
......
...@@ -20,12 +20,15 @@ core_config_remove = [] ...@@ -20,12 +20,15 @@ core_config_remove = []
# Compute the optimization level. `optimize_max` ensures that speed is preferred # Compute the optimization level. `optimize_max` ensures that speed is preferred
# over size on all platforms. # over size on all platforms.
# TODO: It's unclear if the perf vs size win here is a good trade-off for # TODO(crbug.com/1125115): It's unclear if the perf vs size win here is a good
# Android. Investigate that. # trade-off for Android. Investigate that.
if (!is_debug && !is_android) { if (!is_debug && !optimize_for_size) {
core_config_remove += [ "//build/config/compiler:default_optimization" ] core_config_remove += [ "//build/config/compiler:default_optimization" ]
core_config_add += [ "//build/config/compiler:optimize_max" ] core_config_add += [ "//build/config/compiler:optimize_max" ]
} }
if (using_mismatched_sample_profile) {
core_config_remove += [ "//build/config/compiler:afdo_optimize_size" ]
}
core_config_remove += [ "//build/config/compiler:default_symbols" ] core_config_remove += [ "//build/config/compiler:default_symbols" ]
core_config_add += blink_symbols_config core_config_add += blink_symbols_config
......
...@@ -29,6 +29,9 @@ source_set("heap_unsanitized") { ...@@ -29,6 +29,9 @@ source_set("heap_unsanitized") {
# std::atomic<>:: functions must be inlined. # std::atomic<>:: functions must be inlined.
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
if (using_mismatched_sample_profile) {
configs -= [ "//build/config/compiler:afdo_optimize_size" ]
}
sources = [ sources = [
"unsanitized_atomic.cc", "unsanitized_atomic.cc",
...@@ -119,6 +122,8 @@ blink_platform_sources("heap") { ...@@ -119,6 +122,8 @@ blink_platform_sources("heap") {
if (!is_debug && !optimize_for_size) { if (!is_debug && !optimize_for_size) {
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:default_optimization" ]
configs += [ "//build/config/compiler:optimize_max" ] configs += [ "//build/config/compiler:optimize_max" ]
} else if (using_mismatched_sample_profile) {
configs -= [ "//build/config/compiler:afdo_optimize_size" ]
} }
visibility = [ visibility = [
......
...@@ -252,9 +252,8 @@ component("wtf") { ...@@ -252,9 +252,8 @@ component("wtf") {
sources -= [ "text/atomic_string_cf.cc" ] sources -= [ "text/atomic_string_cf.cc" ]
} }
if (!is_debug && !optimize_for_size) { if (using_mismatched_sample_profile) {
configs -= [ "//build/config/compiler:default_optimization" ] configs -= [ "//build/config/compiler:afdo_optimize_size" ]
configs += [ "//build/config/compiler:optimize_max" ]
} }
configs -= [ "//build/config/compiler:default_symbols" ] configs -= [ "//build/config/compiler:default_symbols" ]
......
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