зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369658 - Remove support for running subconfigures in parallel. r=gps
Bug 1358023 and bug 1363992 removed the last uses of subconfigure other than js/src. We don't need all the machinery to run subconfigures in parallel anymore. --HG-- extra : rebase_source : f8fa050976c358834ae4a692d080c1a4105a962e
This commit is contained in:
Родитель
3a412e45bd
Коммит
a493455856
|
@ -17,25 +17,6 @@ import pickle
|
|||
import mozpack.path as mozpath
|
||||
|
||||
|
||||
class Pool(object):
|
||||
def __new__(cls, size):
|
||||
try:
|
||||
import multiprocessing
|
||||
size = min(size, multiprocessing.cpu_count())
|
||||
return multiprocessing.Pool(size)
|
||||
except:
|
||||
return super(Pool, cls).__new__(cls)
|
||||
|
||||
def imap_unordered(self, fn, iterable):
|
||||
return itertools.imap(fn, iterable)
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
||||
def join(self):
|
||||
pass
|
||||
|
||||
|
||||
class File(object):
|
||||
def __init__(self, path):
|
||||
self._path = path
|
||||
|
@ -404,19 +385,13 @@ def subconfigure(args):
|
|||
return 0
|
||||
|
||||
ret = 0
|
||||
# One would think using a ThreadPool would be faster, considering
|
||||
# everything happens in subprocesses anyways, but no, it's actually
|
||||
# slower on Windows. (20s difference overall!)
|
||||
pool = Pool(len(subconfigures))
|
||||
for relobjdir, returncode, output in \
|
||||
pool.imap_unordered(run, subconfigures):
|
||||
for subconfigure in subconfigures:
|
||||
relobjdir, returncode, output = run(subconfigure)
|
||||
print prefix_lines(output, relobjdir)
|
||||
sys.stdout.flush()
|
||||
ret = max(returncode, ret)
|
||||
if ret:
|
||||
break
|
||||
pool.close()
|
||||
pool.join()
|
||||
return ret
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче