Skip to content

Commit

Permalink
perf: compare diff algorithms
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Mar 6, 2012
1 parent 2980b0d commit 8555123
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions t/perf/p4000-diff-algorithms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

test_description="Tests diff generation performance"

. ./perf-lib.sh

test_perf_default_repo

test_perf 'log -3000 (baseline)' '
git log -1000 >/dev/null
'

test_perf 'log --raw -3000 (tree-only)' '
git log --raw -3000 >/dev/null
'

test_perf 'log -p -3000 (Myers)' '
git log -p -3000 >/dev/null
'

test_perf 'log -p -3000 --histogram' '
git log -p -3000 --histogram >/dev/null
'

test_perf 'log -p -3000 --patience' '
git log -p -3000 --patience >/dev/null
'

test_done

0 comments on commit 8555123

Please sign in to comment.