diff options
author | Eric Anholt <eric@anholt.net> | 2011-08-12 12:56:55 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2011-08-28 20:53:44 -0700 |
commit | 796cf1851858a8a8d5562fe50e5e0f0a0c29af98 (patch) | |
tree | 1b5dbda916ccab71b7e4eb8610efc2d852a8a2ed | |
parent | 74389c0bc10806f1093532872bfbc500af345928 (diff) |
piglit: Run concurrent tests from as many threads as there are processors.
Reduces runtime of piglit-run.py -t glslparser from 8.0 seconds to 5.4
seconds on my system.
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r-- | framework/threads.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/threads.py b/framework/threads.py index 855fadf8a..724e84eae 100644 --- a/framework/threads.py +++ b/framework/threads.py @@ -25,6 +25,7 @@ from threadpool import ThreadPool, WorkRequest from patterns import Singleton from threading import RLock from weakref import WeakKeyDictionary +import multiprocessing def synchronized_self(function): ''' @@ -44,7 +45,7 @@ synchronized_self.locks = WeakKeyDictionary() # track the locks for each instanc class ConcurrentTestPool(Singleton): @synchronized_self def init(self): - self.pool = ThreadPool(2) + self.pool = ThreadPool(multiprocessing.cpu_count()) @synchronized_self def put(self, callable_, args = None, kwds = None): |