summaryrefslogtreecommitdiff
path: root/lib/git/async/pool.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-07 23:47:06 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-07 23:47:06 +0200
commit898d47d1711accdfded8ee470520fdb96fb12d46 (patch)
treeac2426a03dbc538fb970cd4fd22a404edb68ce53 /lib/git/async/pool.py
parente825f8b69760e269218b1bf1991018baf3c16b04 (diff)
downloadgitpython-898d47d1711accdfded8ee470520fdb96fb12d46.tar.gz
Task scheduled items lock now uses a dummy lock in serial mode, improving its performance considerably.
Channels now use the AsyncQueue, boosting their throughput to about 5k items / s - this is something one can work with, considering the runtime of each item should be large enough to keep the threads busy. This could be a basis, further testing needed
Diffstat (limited to 'lib/git/async/pool.py')
-rw-r--r--lib/git/async/pool.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/git/async/pool.py b/lib/git/async/pool.py
index 4c97feb0..d6b5711d 100644
--- a/lib/git/async/pool.py
+++ b/lib/git/async/pool.py
@@ -5,6 +5,7 @@ from threading import Lock
from util import (
SyncQueue,
AsyncQueue,
+ DummyLock
)
from task import InputChannelTask
@@ -462,6 +463,11 @@ class Pool(object):
# END add task relation
# END handle input channels for connections
+ # fix locks - in serial mode, the task does not need real locks
+ if self.size() == 0:
+ task._slock = DummyLock()
+ # END improve locks
+
return rc
#} END interface