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 <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Rast committed Mar 6, 2012 at 14:15 UTC 85551232b56e763ecfcc7222e0858bac4e962c80
1 file changed +29
t/perf/p4000-diff-algorithms.sh new
+29
@@ -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