Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 315343003: Add option for link concurrency. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: empty broken Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import copy 6 import copy
7 import hashlib 7 import hashlib
8 import json 8 import json
9 import multiprocessing 9 import multiprocessing
10 import os.path 10 import os.path
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 1575
1576 def CommandWithWrapper(cmd, wrappers, prog): 1576 def CommandWithWrapper(cmd, wrappers, prog):
1577 wrapper = wrappers.get(cmd, '') 1577 wrapper = wrappers.get(cmd, '')
1578 if wrapper: 1578 if wrapper:
1579 return wrapper + ' ' + prog 1579 return wrapper + ' ' + prog
1580 return prog 1580 return prog
1581 1581
1582 1582
1583 def GetDefaultConcurrentLinks(): 1583 def GetDefaultConcurrentLinks():
1584 """Returns a best-guess for a number of concurrent links.""" 1584 """Returns a best-guess for a number of concurrent links."""
1585 pool_size = os.getenv('GYP_LINK_CONCURRENCY')
scottmg 2014/06/05 22:21:45 i think "int(os.getenv('GYP_LINK_CONCURRENCY', 0))
mtklein 2014/06/05 22:24:51 No problem! Do you mean like PS 5? I was avoidin
1586 if pool_size and int(pool_size):
1587 return int(pool_size)
1588
1585 if sys.platform in ('win32', 'cygwin'): 1589 if sys.platform in ('win32', 'cygwin'):
1586 import ctypes 1590 import ctypes
1587 1591
1588 class MEMORYSTATUSEX(ctypes.Structure): 1592 class MEMORYSTATUSEX(ctypes.Structure):
1589 _fields_ = [ 1593 _fields_ = [
1590 ("dwLength", ctypes.c_ulong), 1594 ("dwLength", ctypes.c_ulong),
1591 ("dwMemoryLoad", ctypes.c_ulong), 1595 ("dwMemoryLoad", ctypes.c_ulong),
1592 ("ullTotalPhys", ctypes.c_ulonglong), 1596 ("ullTotalPhys", ctypes.c_ulonglong),
1593 ("ullAvailPhys", ctypes.c_ulonglong), 1597 ("ullAvailPhys", ctypes.c_ulonglong),
1594 ("ullTotalPageFile", ctypes.c_ulonglong), 1598 ("ullTotalPageFile", ctypes.c_ulonglong),
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 arglists.append( 2208 arglists.append(
2205 (target_list, target_dicts, data, params, config_name)) 2209 (target_list, target_dicts, data, params, config_name))
2206 pool.map(CallGenerateOutputForConfig, arglists) 2210 pool.map(CallGenerateOutputForConfig, arglists)
2207 except KeyboardInterrupt, e: 2211 except KeyboardInterrupt, e:
2208 pool.terminate() 2212 pool.terminate()
2209 raise e 2213 raise e
2210 else: 2214 else:
2211 for config_name in config_names: 2215 for config_name in config_names:
2212 GenerateOutputForConfig(target_list, target_dicts, data, params, 2216 GenerateOutputForConfig(target_list, target_dicts, data, params,
2213 config_name) 2217 config_name)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698