author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 25 Oct 2008 13:31:36 +0000 (15:31 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 25 Oct 2008 19:09:31 +0000 (12:09 -0700) | ||
commit | cdcab133ea75e0bd5c2279ce6c5718f4af4d9a03 | |
tree | 5e58d594272a4dfa3bcddc288348c1900539e435 | tree | snapshot |
parent | 86295bb6bac1482d29650d1f77f19d8e7a7cc2fe | commit | diff |
blame: use xdi_diff_hunks(), get rid of struct patch
Based on a patch by Brian Downing, this replaces the struct patch based
code for blame passing with calls to xdi_diff_hunks(). This way we
avoid generating and then parsing patches; we only let the interesting
infos be passed to our callbacks instead. This makes blame a bit faster:
$ blame="./git blame -M -C -C -p --incremental v1.6.0"
# master
$ /usr/bin/time $blame Makefile >/dev/null
1.38user 0.14system 0:01.52elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12226minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.66user 0.13system 0:01.80elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12262minor)pagefaults 0swaps
# this patch series
$ /usr/bin/time $blame Makefile >/dev/null
1.27user 0.12system 0:01.40elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+11836minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.52user 0.12system 0:01.70elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12052minor)pagefaults 0swaps
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Based on a patch by Brian Downing, this replaces the struct patch based
code for blame passing with calls to xdi_diff_hunks(). This way we
avoid generating and then parsing patches; we only let the interesting
infos be passed to our callbacks instead. This makes blame a bit faster:
$ blame="./git blame -M -C -C -p --incremental v1.6.0"
# master
$ /usr/bin/time $blame Makefile >/dev/null
1.38user 0.14system 0:01.52elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12226minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.66user 0.13system 0:01.80elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12262minor)pagefaults 0swaps
# this patch series
$ /usr/bin/time $blame Makefile >/dev/null
1.27user 0.12system 0:01.40elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+11836minor)pagefaults 0swaps
$ /usr/bin/time $blame cache.h >/dev/null
1.52user 0.12system 0:01.70elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+12052minor)pagefaults 0swaps
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-blame.c | diff | blob | history |