From ac62760c52abf28d1fd863f0c0dd48bc4a23d223 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 21 Jun 2010 12:51:46 +0200 Subject: index.add: now uses gitdb.store functionality instead of git-hash-file. The python version is about as fast, but could support multithreading using async --- test/git/performance/lib.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'test/git/performance/lib.py') diff --git a/test/git/performance/lib.py b/test/git/performance/lib.py index 7d2a9f4a..4ac1f1da 100644 --- a/test/git/performance/lib.py +++ b/test/git/performance/lib.py @@ -4,6 +4,11 @@ from test.testlib import * import shutil import tempfile +from git.db import ( + GitCmdObjectDB, + GitDB + ) + from git import ( Repo ) @@ -31,9 +36,14 @@ class TestBigRepoR(TestBase): """TestCase providing access to readonly 'big' repositories using the following member variables: - * gitrepo + * gitrorepo - * Read-Only git repository - actually the repo of git itself""" + * Read-Only git repository - actually the repo of git itself + + * puregitrorepo + + * As gitrepo, but uses pure python implementation + """ #{ Invariants head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca' @@ -43,20 +53,23 @@ class TestBigRepoR(TestBase): @classmethod def setUpAll(cls): super(TestBigRepoR, cls).setUpAll() - cls.gitrorepo = Repo(resolve_or_fail(k_env_git_repo)) + repo_path = resolve_or_fail(k_env_git_repo) + cls.gitrorepo = Repo(repo_path, odbt=GitCmdObjectDB) + cls.puregitrorepo = Repo(repo_path, odbt=GitDB) class TestBigRepoRW(TestBigRepoR): """As above, but provides a big repository that we can write to. - Provides ``self.gitrwrepo``""" + Provides ``self.gitrwrepo`` and ``self.puregitrwrepo``""" @classmethod def setUpAll(cls): super(TestBigRepoRW, cls).setUpAll() dirname = tempfile.mktemp() os.mkdir(dirname) - cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True) + cls.gitrwrepo = cls.gitrorepo.clone(dirname, shared=True, bare=True, odbt=GitCmdObjectDB) + cls.puregitrwrepo = Repo(dirname, odbt=GitDB) @classmethod def tearDownAll(cls): -- cgit v1.2.1