From f0c05ea8da7932961af162bb30231640b89e40bc Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 5 Jul 2011 18:13:30 +0200 Subject: 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 --- git/test/performance/db/test_packedodb_pure.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'git/test') 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) -- cgit v1.2.3