Index: build/gyp_chromium |
diff --git a/build/gyp_chromium b/build/gyp_chromium |
index 7709d071a9b9a1a8fb420e420463f1d1517a2f89..1890d2a0cd5d813bc2ead47a0e35b800bbad850c 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 |