summaryrefslogtreecommitdiff
path: root/git/test/performance
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/test/performance
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/test/performance')
-rw-r--r--git/test/performance/db/test_packedodb_pure.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/git/test/performance/db/test_packedodb_pure.py b/git/test/performance/db/test_packedodb_pure.py
index 4ea09779..11497d9d 100644
--- a/git/test/performance/db/test_packedodb_pure.py
+++ b/git/test/performance/db/test_packedodb_pure.py
@@ -49,18 +49,17 @@ class TestPurePackedODB(TestPurePackedODBPerformanceBase):
count = 0
total_size = 0
st = time()
- objs = list()
for sha in rorepo.sha_iter():
count += 1
- objs.append(rorepo.stream(sha))
+ rorepo.stream(sha)
if count == ni:
break
#END gather objects for pack-writing
elapsed = time() - st
- print >> sys.stderr, "PDB Streaming: Got %i streams from %s by sha in in %f s ( %f streams/s )" % (ni, rorepo.__class__.__name__, elapsed, ni / elapsed)
+ print >> sys.stderr, "PDB Streaming: Got %i streams from %s by sha in in %f s ( %f streams/s )" % (count, rorepo.__class__.__name__, elapsed, count / elapsed)
st = time()
- PackEntity.write_pack(objs, ostream.write)
+ PackEntity.write_pack((rorepo.stream(sha) for sha in rorepo.sha_iter()), ostream.write, object_count=ni)
elapsed = time() - st
total_kb = ostream.bytes_written() / 1000
print >> sys.stderr, "PDB Streaming: Wrote pack of size %i kb in %f s (%f kb/s)" % (total_kb, elapsed, total_kb/elapsed)