diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-06 21:44:33 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-06 21:44:33 +0000 |
commit | 8fc5618676949b8bebd39f584bf193314b5eb566 (patch) | |
tree | 98b37da8c3b10c04087589c49e56d114bd7d504c /tools/gn/command_desc.cc | |
parent | 430248b7a336509b94b30df5fe6e982d9efb43f1 (diff) | |
download | chromium_src-8fc5618676949b8bebd39f584bf193314b5eb566.zip chromium_src-8fc5618676949b8bebd39f584bf193314b5eb566.tar.gz chromium_src-8fc5618676949b8bebd39f584bf193314b5eb566.tar.bz2 |
This is an ordered set tailored to GN's (simple) needs.
This vector is now used to store all config lists. Previously the code did a bunch of work to uniquify configs at certain points (in target.cc) but direct_dependent_configs still ended up with lots of duplicates.
Before this patch the chrome/browser target has 41098 direct_dependent_configs, and after this patch it has 7. Apparently we were also spending a lot of time on these. Before this patch Windows wall clock time was 1031ms, and after this patch it's 831ms. Linux was 834ms before and 593ms after.
Also fix minor build issues in base I noticed while working on this.
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/26537002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/command_desc.cc')
-rw-r--r-- | tools/gn/command_desc.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/gn/command_desc.cc b/tools/gn/command_desc.cc index 53e322d..f89ea41 100644 --- a/tools/gn/command_desc.cc +++ b/tools/gn/command_desc.cc @@ -250,8 +250,27 @@ void PrintConfigsVector(const Target* target, } } +void PrintConfigsVector(const Target* target, + const UniqueVector<LabelConfigPair>& configs, + const std::string& heading, + bool display_header) { + if (configs.empty()) + return; + + // Don't sort since the order determines how things are processed. + if (display_header) + OutputString("\n" + heading + " (in order applying):\n"); + + Label toolchain_label = target->label().GetToolchainLabel(); + for (size_t i = 0; i < configs.size(); i++) { + OutputString(" " + + configs[i].label.GetUserVisibleName(toolchain_label) + "\n"); + } +} + void PrintConfigs(const Target* target, bool display_header) { - PrintConfigsVector(target, target->configs(), "configs", display_header); + PrintConfigsVector(target, target->configs().vector(), "configs", + display_header); } void PrintDirectDependentConfigs(const Target* target, bool display_header) { |