[PATCH/RFC/GSoC 01/17] perf: introduce performance tests for git-rebase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To determine the speedup (or slowdown) of the upcoming git-rebase
rewrite to C, add a simple performance test for each of the 3 git-rebase
backends (am, merge and interactive).

Signed-off-by: Paul Tan <pyokagan@xxxxxxxxx>
---
 t/perf/p3400-rebase.sh             | 25 +++++++++++++++++++++++++
 t/perf/p3402-rebase-merge.sh       | 25 +++++++++++++++++++++++++
 t/perf/p3404-rebase-interactive.sh | 26 ++++++++++++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100755 t/perf/p3400-rebase.sh
 create mode 100755 t/perf/p3402-rebase-merge.sh
 create mode 100755 t/perf/p3404-rebase-interactive.sh

diff --git a/t/perf/p3400-rebase.sh b/t/perf/p3400-rebase.sh
new file mode 100755
index 0000000..f172a64
--- /dev/null
+++ b/t/perf/p3400-rebase.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description="Tests rebase performance with am backend"
+
+. ./perf-lib.sh
+
+test_perf_default_repo
+test_checkout_worktree
+
+# Setup a topic branch with 50 commits
+test_expect_success 'setup topic branch' '
+	git checkout -b perf-topic-branch master &&
+	for i in $(test_seq 50); do
+		test_commit perf-$i file
+	done &&
+	git tag perf-topic-branch-initial
+'
+
+test_perf 'rebase --onto master^' '
+	git checkout perf-topic-branch &&
+	git reset --hard perf-topic-branch-initial &&
+	git rebase --onto master^ master
+'
+
+test_done
diff --git a/t/perf/p3402-rebase-merge.sh b/t/perf/p3402-rebase-merge.sh
new file mode 100755
index 0000000..b71ce12
--- /dev/null
+++ b/t/perf/p3402-rebase-merge.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description="Tests rebase performance with merge backend"
+
+. ./perf-lib.sh
+
+test_perf_default_repo
+test_checkout_worktree
+
+# Setup a topic branch with 50 commits
+test_expect_success 'setup topic branch' '
+	git checkout -b perf-topic-branch master &&
+	for i in $(test_seq 50); do
+		test_commit perf-$i file
+	done &&
+	git tag perf-topic-branch-initial
+'
+
+test_perf 'rebase -m --onto master^' '
+	git checkout perf-topic-branch &&
+	git reset --hard perf-topic-branch-initial &&
+	git rebase -m --onto master^ master
+'
+
+test_done
diff --git a/t/perf/p3404-rebase-interactive.sh b/t/perf/p3404-rebase-interactive.sh
new file mode 100755
index 0000000..aaca105
--- /dev/null
+++ b/t/perf/p3404-rebase-interactive.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description="Tests interactive rebase performance"
+
+. ./perf-lib.sh
+. "$TEST_DIRECTORY"/lib-rebase.sh
+
+test_perf_default_repo
+test_checkout_worktree
+
+# Setup a topic branch with 50 commits
+test_expect_success 'setup topic branch' '
+	git checkout -b perf-topic-branch master &&
+	for i in $(test_seq 50); do
+		test_commit perf-$i file
+	done &&
+	git tag perf-topic-branch-initial
+'
+
+test_perf 'rebase -i --onto master^' '
+	git checkout perf-topic-branch &&
+	git reset --hard perf-topic-branch-initial &&
+	GIT_SEQUENCE_EDITOR=: git rebase -i --onto master^ master
+'
+
+test_done
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]