diff options
Diffstat (limited to 'git/test/performance')
-rw-r--r-- | git/test/performance/lib.py | 3 | ||||
-rw-r--r-- | git/test/performance/test_odb.py | 5 | ||||
-rw-r--r-- | git/test/performance/test_streams.py | 20 |
3 files changed, 17 insertions, 11 deletions
diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index e92e2b2d..928821ed 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -50,7 +50,8 @@ class TestBigRepoR(TestBase): repo_path = os.environ.get(k_env_git_repo) if repo_path is None: logging.info( - "You can set the %s environment variable to a .git repository of your choice - defaulting to the gitpython repository", k_env_git_repo) + ("You can set the %s environment variable to a .git repository of" % k_env_git_repo) + + "your choice - defaulting to the gitpython repository") repo_path = os.path.dirname(__file__) # end set some repo path self.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB) diff --git a/git/test/performance/test_odb.py b/git/test/performance/test_odb.py index 9d857260..1b570fa7 100644 --- a/git/test/performance/test_odb.py +++ b/git/test/performance/test_odb.py @@ -61,9 +61,10 @@ class TestObjDBPerformance(TestBigRepoR): # END for each bloblist elapsed = time() - st - print >> sys.stderr, "%s: Retrieved %i blob (%i KiB) and their data in %g s ( %f blobs / s, %f KiB / s )" % ( - type(repo.odb), nb, data_bytes / 1000, elapsed, nb / elapsed, (data_bytes / 1000) / elapsed) + msg = "%s: Retrieved %i blob (%i KiB) and their data in %g s ( %f blobs / s, %f KiB / s )"\ + % (type(repo.odb), nb, data_bytes / 1000, elapsed, nb / elapsed, (data_bytes / 1000) / elapsed) results[2].append(elapsed) + print >> sys.stderr, msg # END for each repo type # final results diff --git a/git/test/performance/test_streams.py b/git/test/performance/test_streams.py index facf9eed..18f19db3 100644 --- a/git/test/performance/test_streams.py +++ b/git/test/performance/test_streams.py @@ -44,8 +44,9 @@ class TestObjDBPerformance(TestBigRepoR): fsize_kib = os.path.getsize(db_file) / 1000 size_kib = size / 1000 - print >> sys.stderr, "Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)" % ( - size_kib, fsize_kib, desc, elapsed_add, size_kib / elapsed_add) + msg = "Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)" + msg %= (size_kib, fsize_kib, desc, elapsed_add, size_kib / elapsed_add) + print >> sys.stderr, msg # reading all at once st = time() @@ -55,8 +56,9 @@ class TestObjDBPerformance(TestBigRepoR): stream.seek(0) assert shadata == stream.getvalue() - print >> sys.stderr, "Read %i KiB of %s data at once from loose odb in %f s ( %f Read KiB / s)" % ( - size_kib, desc, elapsed_readall, size_kib / elapsed_readall) + msg = "Read %i KiB of %s data at once from loose odb in %f s ( %f Read KiB / s)" + msg %= (size_kib, desc, elapsed_readall, size_kib / elapsed_readall) + print >> sys.stderr, msg # reading in chunks of 1 MiB cs = 512 * 1000 @@ -99,8 +101,9 @@ class TestObjDBPerformance(TestBigRepoR): # as its the same sha, we reuse our path fsize_kib = os.path.getsize(db_file) / 1000 - print >> sys.stderr, "Added %i KiB (filesize = %i KiB) of %s data to using git-hash-object in %f s ( %f Write KiB / s)" % ( - size_kib, fsize_kib, desc, gelapsed_add, size_kib / gelapsed_add) + msg = "Added %i KiB (filesize = %i KiB) of %s data to using git-hash-object in %f s ( %f Write KiB / s)" + msg %= (size_kib, fsize_kib, desc, gelapsed_add, size_kib / gelapsed_add) + print >> sys.stderr, msg # compare ... print >> sys.stderr, "Git-Python is %f %% faster than git when adding big %s files" % ( @@ -126,8 +129,9 @@ class TestObjDBPerformance(TestBigRepoR): break # END read stream gelapsed_readchunks = time() - st - print >> sys.stderr, "Read %i KiB of %s data in %i KiB chunks from git-cat-file in %f s ( %f Read KiB / s)" % ( - size_kib, desc, cs_kib, gelapsed_readchunks, size_kib / gelapsed_readchunks) + msg = "Read %i KiB of %s data in %i KiB chunks from git-cat-file in %f s ( %f Read KiB / s)" + msg %= (size_kib, desc, cs_kib, gelapsed_readchunks, size_kib / gelapsed_readchunks) + print >> sys.stderr, msg # compare print >> sys.stderr, "Git-Python is %f %% faster than git when reading big %s files in chunks" % ( |