summaryrefslogtreecommitdiffstats
path: root/tools/gn/scope.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 23:25:04 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 23:25:04 +0000
commit26542b05b057b860dda4fe73a8ab179b86bccadd (patch)
treeab39fe280ad6581451492e8396e88d57ffbbd3b9 /tools/gn/scope.h
parentbf72b5786dea227736e1394c5b5c42cecc422e31 (diff)
downloadchromium_src-26542b05b057b860dda4fe73a8ab179b86bccadd.zip
chromium_src-26542b05b057b860dda4fe73a8ab179b86bccadd.tar.gz
chromium_src-26542b05b057b860dda4fe73a8ab179b86bccadd.tar.bz2
Refactor the GN threading model to reduce locking and simplify execution.
Old design: item_tree manages dependency resolution, target_manager creates and hooks up the target dependencies, and the toolchain manager does all kinds of crazy ordering and loading stuff on every thread. There is lots of locking every time the dependency tree is modified. This patch completely deletes the toolchain manager, item tree, item node, and target manager. The new design is that the build files are executed on background threads, but then they come back to the main thread which assembles the dependency tree and schedules other file loads. This eliminates almost all locking and a lot of complexity. The Loader now manages loading the different build files in the correct context, and managing dependencies (loading the build config first, for example). The Builder manages the dependency tree and requests that the Loader load files that it encounters references to. This simpler design reduces non-test code by ~350 lines. In the current gn build, lock acquisitions go down from 1808 to 116 and it saves about 20ms wall clock time (8% faster). This is a bit deceiving, though, because most of the time is spent on pkg-config which is constant. It speeds up running individual build files by 1000-1500%. The work of putting the tree together that used to take up this time inside locks is now transferred to the main thread, which looks like it is *sometimes* a bottleneck. This should be easier to optimize in the future, though. Other tweaks: - I fixed cycle finding - Directories look prettier on Windows using the "desc" command - Tracing output now includes the main thread and marks it as such - I updated the base BUILD.gn file for the more recent tree. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/56433003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/scope.h')
-rw-r--r--tools/gn/scope.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/tools/gn/scope.h b/tools/gn/scope.h
index 0d1c156..d4a35ff 100644
--- a/tools/gn/scope.h
+++ b/tools/gn/scope.h
@@ -165,8 +165,7 @@ class Scope {
}
// Indicates if we're currently processing the build configuration file.
- // This is true when processing the config file for any toolchain. See also
- // *ProcessingDefaultBuildConfig() below.
+ // This is true when processing the config file for any toolchain.
//
// To set or clear the flag, it must currently be in the opposite state in
// the current scope. Note that querying the state of the flag recursively
@@ -176,12 +175,6 @@ class Scope {
void ClearProcessingBuildConfig();
bool IsProcessingBuildConfig() const;
- // Indicates we're currently processing the default toolchain's build
- // configuration file.
- void SetProcessingDefaultBuildConfig();
- void ClearProcessingDefaultBuildConfig();
- bool IsProcessingDefaultBuildConfig() const;
-
// Indicates if we're currently processing an import file.
//
// See SetProcessingBaseConfig for how flags work.