diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 18:52:23 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-30 18:52:23 +0000 |
commit | 7e6497fa01580df1a4642786797992f2a7ea01e8 (patch) | |
tree | 2d50c163bd2cea309cc3165217028218d5b6e44a /build/gyp_chromium | |
parent | 1368a5f9d962313c46ebdbb4d91a2ffe43c25e6a (diff) | |
download | chromium_src-7e6497fa01580df1a4642786797992f2a7ea01e8.zip chromium_src-7e6497fa01580df1a4642786797992f2a7ea01e8.tar.gz chromium_src-7e6497fa01580df1a4642786797992f2a7ea01e8.tar.bz2 |
Add use of the Psyco JIT compiler to GYP on Windows. On my z600 with 12 GB of RAM, this shortens the time taken for a warm run of build/chromium_gyp from approximately 90 seconds down to approximately 70 seconds. On the other hand, it increases maximum memory usage for the GYP process from ~132 MB to ~158 MB on the same test system.
At the moment it is unknown whether using Psyco on Mac and Linux would pay off; follow-up changes may address this if it is.
BUG=none
TEST=things build correctly
Review URL: http://codereview.chromium.org/6778017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79871 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/gyp_chromium')
-rwxr-xr-x | build/gyp_chromium | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/build/gyp_chromium b/build/gyp_chromium index 7709d07..1890d2a 100755 --- a/build/gyp_chromium +++ b/build/gyp_chromium @@ -1,6 +1,6 @@ #!/usr/bin/python -# Copyright (c) 2009 The Chromium Authors. All rights reserved. +# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -19,6 +19,25 @@ chrome_src = os.path.normpath(os.path.join(script_dir, os.pardir)) sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) import gyp +# On Windows, Psyco shortens warm runs of build/gyp_chromium by about +# 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70 +# seconds. Conversely, memory usage of build/gyp_chromium with Psyco +# maxes out at about 158 MB vs. 132 MB without it. +# +# Psyco uses native libraries, so we need to load a different +# installation depending on which OS we are running under. It has not +# been tested whether using Psyco on our Mac and Linux builds is worth +# it (the GYP running time is a lot shorter, so the JIT startup cost +# may not be worth it). +if sys.platform == 'win32': + try: + sys.path.insert(0, os.path.join(chrome_src, 'third_party', 'psyco_win32')) + import psyco + except: + psyco = None +else: + psyco = None + def apply_gyp_environment(file_path=None): """ Reads in a *.gyp_env file and applies the valid keys to os.environ. @@ -79,6 +98,11 @@ def additional_include_files(args=[]): if __name__ == '__main__': args = sys.argv[1:] + # Use the Psyco JIT if available. + if psyco: + psyco.profile() + print "Enabled Psyco JIT." + # Fall back on hermetic python if we happen to get run under cygwin. # TODO(bradnelson): take this out once this issue is fixed: # http://code.google.com/p/gyp/issues/detail?id=177 |