From 796cf1851858a8a8d5562fe50e5e0f0a0c29af98 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 12 Aug 2011 12:56:55 -0700 Subject: 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 --- framework/threads.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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): -- cgit v1.2.3