Chromium Code Reviews| Index: build/gyp_chromium |
| diff --git a/build/gyp_chromium b/build/gyp_chromium |
| index 7709d071a9b9a1a8fb420e420463f1d1517a2f89..2c0e71668129f2693f99f28801635dd7f3647ae4 100755 |
| --- a/build/gyp_chromium |
| +++ b/build/gyp_chromium |
| @@ -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 os.name == 'nt': |
|
bradn
2011/03/30 16:31:36
sys.platform == 'win32' be more idiomatic with oth
Jói
2011/03/30 16:50:21
Done.
|
| + 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 |