Skip to content

Commit 8555123

Browse files
trastgitster
authored andcommitted
perf: compare diff algorithms
8c912ee (teach --histogram to diff, 2011-07-12) claimed histogram diff was faster than both Myers and patience. We have since incorporated a performance testing framework, so add a test that compares the various diff tasks performed in a real 'log -p' workload. This does indeed show that histogram diff slightly beats Myers, while patience is much slower than the others. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2980b0d commit 8555123

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

t/perf/p4000-diff-algorithms.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
test_description="Tests diff generation performance"
4+
5+
. ./perf-lib.sh
6+
7+
test_perf_default_repo
8+
9+
test_perf 'log -3000 (baseline)' '
10+
git log -1000 >/dev/null
11+
'
12+
13+
test_perf 'log --raw -3000 (tree-only)' '
14+
git log --raw -3000 >/dev/null
15+
'
16+
17+
test_perf 'log -p -3000 (Myers)' '
18+
git log -p -3000 >/dev/null
19+
'
20+
21+
test_perf 'log -p -3000 --histogram' '
22+
git log -p -3000 --histogram >/dev/null
23+
'
24+
25+
test_perf 'log -p -3000 --patience' '
26+
git log -p -3000 --patience >/dev/null
27+
'
28+
29+
test_done

0 commit comments

Comments
 (0)