Commit 7bf1119c authored by brucedawson's avatar brucedawson Committed by Commit bot

Enable incremental linking in release component builds

Component builds are, by definition, not optimized for maximum
performance. So incremental linking - which trades a little bit of
performance for much faster build times - is appropriate in release
component builds, as well as in debug builds.

This change enables incremental linking in release component builds.
This also requires turning off /OPT:ICF and /PROFILE in component
builds because they are incompatible with /incremental, but they are
performance related flags so they are also not important for component
builds.

blink_core.dll cannot be incrementally linked in debug x64 component
builds, but it *can* be incrementally linked in release x64 component
builds (and debug/release x86 component builds), and this change
enables incremental linking of blink_core.dll in all supported
configurations.

This drops the chrome rebuild time after touching
third_party\WebKit\Source\core\html\AutoplayExperimentHelper.cpp from
~260 seconds to 9 seconds. The chrome rebuild time after touching
base\win\registry.cc drops from ~200 seconds to less than 2 seconds,
with 21 of 24 link steps skipped entirely.

This also fixes some /INCREMENTAL /OPT:ICF mismatch warnings.

BUG=608801,621236

Review-Url: https://codereview.chromium.org/2331373006
Cr-Commit-Position: refs/heads/master@{#418660}
parent e8cefaed
......@@ -1223,7 +1223,10 @@ if (is_win) {
"/Gw",
]
}
common_optimize_on_ldflags = [ "/OPT:ICF" ] # Redundant COMDAT folding.
common_optimize_on_ldflags = []
if (!is_component_build) {
common_optimize_on_ldflags += [ "/OPT:ICF" ] # Redundant COMDAT folding.
}
if (is_official_build) {
common_optimize_on_ldflags += [
"/OPT:REF", # Remove unreferenced data.
......
......@@ -101,8 +101,11 @@ config("compiler") {
# Ensures that the PDB file contains FIXUP information (growing the PDB file
# by about 5%) but does not otherwise alter the output binary. This
# information is used by the Syzygy optimization tool when decomposing the
# release image.
if (!is_debug && !is_win_fastlink && !is_clang) {
# release image. It is enabled for syzyasan builds and opportunistically for
# other builds where it is not prohibited (not supported when incrementally
# linking, using /debug:fastlink, or building with clang).
if (is_syzyasan ||
(!is_debug && !is_component_build && !is_win_fastlink && !is_clang)) {
ldflags = [ "/PROFILE" ]
}
......@@ -312,8 +315,9 @@ config("windowed") {
incremental_linking_on_switch = [ "/INCREMENTAL" ]
incremental_linking_off_switch = [ "/INCREMENTAL:NO" ]
# Disable incremental linking for syzyasan
if (is_debug && !is_syzyasan) {
# Disable incremental linking for syzyasan, enable for debug builds and all
# component builds - any builds where performance is not job one.
if ((is_debug || is_component_build) && !is_syzyasan) {
default_incremental_linking_switch = incremental_linking_on_switch
} else {
default_incremental_linking_switch = incremental_linking_off_switch
......
......@@ -180,8 +180,10 @@ component("core") {
if (is_win && is_debug && is_component_build && current_cpu == "x64") {
# Incremental linking doesn't work on this target in debug mode for
# 64-bit builds - the .ilk file gets too large and the incremental
# link silently fails. Therefore 32-bit builds should be used for
# fastest incremental build performance.
# link silently fails. Therefore 32-bit builds or 64-bit release builds
# (component either way) should be used for fastest incremental build
# performance. VC++ bug filed for 64-bit debug incremental link failures:
# https://connect.microsoft.com/VisualStudio/feedback/details/2846790
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]
}
......
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