summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-07-05 18:13:30 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-07-05 18:13:49 +0200
commitf0c05ea8da7932961af162bb30231640b89e40bc (patch)
treeb32d5b271cb1c1adfb091d7b29d0ee0033c1866a /git/util.py
parent21499d9ae9edccd18c64bf6b15f248575c3da95b (diff)
downloadgitpython-f0c05ea8da7932961af162bb30231640b89e40bc.tar.gz
util: pick the type of memory manager based on the python version, to have optimal results in all cases (at least the ones I can test)
pack: now works properly with a sliding memory manager test_packedodb_pure: fixed very memory hungry implementation by using an iterator. This will of course reduce the measured performance a bit, but 750MB of memory is just a little bit too much for an ordinary test. Maybe it would be alright to just reduce the number of items ... but performance isn't a strength of python after all
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/git/util.py b/git/util.py
index 0c018447..0e7e4cba 100644
--- a/git/util.py
+++ b/git/util.py
@@ -17,6 +17,7 @@ import shutil
import tempfile
from smmap import (
StaticWindowMapManager,
+ SlidingWindowMapManager,
SlidingWindowMapBuffer
)
@@ -72,7 +73,11 @@ pool = ThreadPool(0)
# initialize our global memory manager instance
# Use it to free cached (and unused) resources.
-mman = StaticWindowMapManager()
+if sys.version_info[1] < 6:
+ mman = StaticWindowMapManager()
+else:
+ mman = SlidingWindowMapManager()
+#END handle mman
#} END globals