Add some performance testing scripts
PATCH 1/1 Add some performance testing scripts
find_patchbomb.py: Given a git repo, finds the longest linear sequence
of commits. Useful for testing StGit on a real repository.
setup.sh: Creates two test repositories, one synthetic and one based
on the Linux kernel repo, with strategically placed tags.
create_synthetic_repo.py: Helper script for setup.sh; it produces
output that is to be fed to git fast-import.
perftest.py: Runs one of a (small) number of hard-coded performance
tests against a copy of one of the repos created by setup.sh. The initial testcases all involve uncommitting a large number of patches and then rebasing them.
---
perf/.gitignore | 2 + perf/create_synthetic_repo.py | 61 ++++++++++++++++++++++++++++ perf/find_patchbomb.py | 31 ++++++++++++++ perf/perftest.py | 89 +++++++++++++++++++++++++++++++++++++++++ perf/setup.sh | 52 ++++++++++++++++++++++++ 5 files changed, 235 insertions(+), 0 deletions(-) create mode 100644 perf/.gitignore create mode 100644 perf/create_synthetic_repo.py create mode 100644 perf/find_patchbomb.py create mode 100644 perf/perftest.py create mode 100644 perf/setup.sh
perf/.gitignore new file +2 -0
@@ -0,0 +1,2 @@ +/*.orig +/*.trash
perf/create_synthetic_repo.py new file +61 -0
61 lines not on this page · raw message
perf/find_patchbomb.py new file +31 -0
@@ -0,0 +1,31 @@ +# Feed this with git rev-list HEAD --parents + +import sys + +parents = {} +for line in sys.stdin.readlines(): + commits = line.split() + parents[commits[0]] = commits[1:] + +sequence_num = {} +stack = [] +for commit in parents.keys(): + stack.append(commit) + while stack: + c = stack.pop() + if c in sequence_num: + continue + ps = parents[c] + if len(ps) == 1: + p = ps[0] + if p in sequence_num: + sequence_num[c] = 1 + sequence_num[p] + else: + stack.append(c) + stack.append(p) + else: + sequence_num[c] = 0 + +(num, commit) = max((num, commit) for (commit, num) + in sequence_num.iteritems()) +print '%s is a sequence of %d patches' % (commit, num)
perf/perftest.py new file +89 -0
89 lines not on this page · raw message
perf/setup.sh new file +52 -0
52 lines not on this page · raw message
2008/7/16 Karl Hasselström <[email protected]>:
Quoted 6 lines
find_patchbomb.py: Given a git repo, finds the longest linear sequence
of commits. Useful for testing StGit on a real repository.
setup.sh: Creates two test repositories, one synthetic and one based
on the Linux kernel repo, with strategically placed tags.
Quoted 7 lines
create_synthetic_repo.py: Helper script forsetup.sh; it produces
output that is to be fed to git fast-import.
perftest.py: Runs one of a (small) number of hard-coded performance
tests against a copy of one of the repos created bysetup.sh. The initial testcases all involve uncommitting a large number of patches and then rebasing them.
Looks good. Thanks.
Signature · 1 line
Catalin