From 187e26524f917344aa269a13bf372c08316e8bb4 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 5 Mar 2014 21:15:27 -0800 Subject: [PATCH] cpu_count *2 is a step too far, the default is faster --- mp_compile.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mp_compile.py b/mp_compile.py index a0a59faa4..947a4086e 100644 --- a/mp_compile.py +++ b/mp_compile.py @@ -1,7 +1,7 @@ # A monkey patch of the base distutils.ccompiler to use parallel builds # Tested on 2.7, looks to be identical to 3.3. -from multiprocessing import Pool +from multiprocessing import Pool, cpu_count from distutils.ccompiler import CCompiler # hideous monkeypatching. but. but. but. @@ -29,12 +29,7 @@ def _mp_compile(self, sources, output_dir=None, macros=None, depends, extra_postargs) cc_args = self._get_cc_args(pp_opts, debug, extra_preargs) - try: - processes = cpu_count() * 2 - except: - processes = 2 - - pool = Pool(processes) + pool = Pool() print ("Building using %d processes" % pool._processes) arr = [(self, obj, build, cc_args, extra_postargs, pp_opts) for obj in objects] results = pool.map_async(_mp_compile_one,arr)