diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 18:21:49 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 18:21:49 +0000 |
commit | 523e9c6c50633ef76ee0db33f29901ceb7dd6778 (patch) | |
tree | ada26d61e556aff8055aae2ea6f055042e94c67e /build/SConscript.main | |
parent | 57cbb28ea940f5b6cd0076aace9511e553b26f98 (diff) | |
download | chromium_src-523e9c6c50633ef76ee0db33f29901ceb7dd6778.zip chromium_src-523e9c6c50633ef76ee0db33f29901ceb7dd6778.tar.gz chromium_src-523e9c6c50633ef76ee0db33f29901ceb7dd6778.tar.bz2 |
speed up scons
I did some profiling and found that we spend a lot of
time in SCons/Subst.py resolving paths with $ vars in
them. By pre-resolving some common $ vars, we can get
a 16% speed up of an empty build (running hammer Hammer
when everything is already built). On my work desktop,
this is a saving from ~180s to do an empty build to
~150s to do an empty build.
I found which symbols to pre-resolve by gathering stats
on what symbols were resolved during a single run.
Originally, these were the top 10 calls to
StringSubber.substitute:
91466 /src/gclient-git/src/chrome
89457 $MAIN_DIR/Hammer
89457 $DESTINATION_ROOT
89447 $TARGET_ROOT/obj
65514 $OBJ_ROOT/webkit
18169 $OBJ_ROOT/third_party
8991 -I/src/gclient-git/src/webkit/pending
5700 $THIRD_PARTY_DIR/WebKit
4488 -I/src/gclient-git/src/webkit/port/platform/network
4488 -I/src/gclient-git/src/webkit/port/platform
Afterwards, the top 10 calls were:
65514 /src/gclient-git/src/chrome/Hammer/obj/webkit
23933 /src/gclient-git/src/chrome/Hammer/obj
18169 $OBJ_ROOT/third_party
8991 -I/src/gclient-git/src/webkit/pending
5700 $THIRD_PARTY_DIR/WebKit
4488 -I/src/gclient-git/src/webkit/port/platform/network
4488 -I/src/gclient-git/src/webkit/port/platform
3813 $OBJ_ROOT/skia
3498 $THIRD_PARTY_DIR/icu38
3456 $THIRD_PARTY_WEBKIT_DIR/JavaScriptCore
Adding these rules cuts the total number of calls to
StringSubber.substitute from 1001817 to 665933.
Review URL: http://codereview.chromium.org/8608
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/SConscript.main')
-rw-r--r-- | build/SConscript.main | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/build/SConscript.main b/build/SConscript.main index 617e5b4..139d29b 100644 --- a/build/SConscript.main +++ b/build/SConscript.main @@ -79,6 +79,16 @@ env = Environment( '__env__, RDirs, TARGET, SOURCE)}'), ) +# We pre-resolve some common targets. We end up spending lots of time +# resolving these over and over again. +env.Replace( + CHROME_SRC_DIR = str(env.Dir('$CHROME_SRC_DIR')), + DESTINATION_ROOT = str(env.Dir('$DESTINATION_ROOT')), + TARGET_ROOT = str(env.Dir('$TARGET_ROOT')), + OBJ_ROOT = str(env.Dir('$OBJ_ROOT')), + WEBKIT_DIR = str(env.Dir('$WEBKIT_DIR')), +) + env.Append(LIBPATH = ['$LIBS_DIR']) |