summaryrefslogtreecommitdiff
path: root/lib/git/async/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-07 22:00:47 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-07 22:00:47 +0200
commitbe06e87433685b5ea9cfcc131ab89c56cf8292f2 (patch)
tree6939637f51709f425cbd61d949b057124be553f9 /lib/git/async/util.py
parent654e54d200135e665e07e9f0097d913a77f169da (diff)
downloadgitpython-be06e87433685b5ea9cfcc131ab89c56cf8292f2.tar.gz
improved testing to test the actual async handling of the pool. there are still inconsistencies that need to be fixed, but it already improved, especially the 4-thread performance which now is as fast as the dual-threaded performance
Diffstat (limited to 'lib/git/async/util.py')
-rw-r--r--lib/git/async/util.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/git/async/util.py b/lib/git/async/util.py
index 432d1736..85d44694 100644
--- a/lib/git/async/util.py
+++ b/lib/git/async/util.py
@@ -59,7 +59,7 @@ class SyncQueue(deque):
class HSCondition(_Condition):
"""An attempt to make conditions less blocking, which gains performance
in return by sleeping less"""
- delay = 0.00002 # reduces wait times, but increases overhead
+ delay = 0.00005 # reduces wait times, but increases overhead
def wait(self, timeout=None):
waiter = Lock()
@@ -85,7 +85,9 @@ class HSCondition(_Condition):
remaining = endtime - _time()
if remaining <= 0:
break
- delay = min(delay * 2, remaining, .05)
+ # this makes 4 threads working as good as two, but of course
+ # it causes more frequent micro-sleeping
+ #delay = min(delay * 2, remaining, .05)
_sleep(delay)
# END endless loop
if not gotit: