From 523e9c6c50633ef76ee0db33f29901ceb7dd6778 Mon Sep 17 00:00:00 2001 From: "tc@google.com" Date: Mon, 27 Oct 2008 18:21:49 +0000 Subject: 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 --- build/SConscript.main | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'build/SConscript.main') 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']) -- cgit v1.1