Skip to contentSkip to conversation

blame now knows -S

DISCUSSION Junio C Hamano 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I've made a few changes to "git blame" myself:

- fix breakage caused by recent revision walker reorganization;
- use built-in xdiff instead of spawning GNU diff;
- implement -S <ancestry-file> like annotate does.

Depending on the density of changes, it now appears that blame is 10%-30% faster than annotate. I thought CVS emulator might be interested to give it a whirl..

#1 lore raw
Quoted 10 lines · Junio C Hamano

I've made a few changes to "git blame" myself:

- fix breakage caused by recent revision walker reorganization;
- use built-in xdiff instead of spawning GNU diff;
- implement -S <ancestry-file> like annotate does.

Depending on the density of changes, it now appears that blame is 10%-30% faster than annotate. I thought CVS emulator might be interested to give it a whirl..

Nice work!

There is another possible optimisation with respect to xdiff. Instead of producing the diff on the xdiff side and parsing the diff in blame.c, we could add another call back which just gets the relevant information from the hunk header. I don't know how much we would gain from this, but it might be worth a try.

- Fredrik

#2 lore raw
Quoted 5 lines · Fredrik Kuivinen

There is another possible optimisation with respect to xdiff. Instead of producing the diff on the xdiff side and parsing the diff in blame.c, we could add another call back which just gets the relevant information from the hunk header. I don't know how much we would gain from this, but it might be worth a try.

I've tried and then it turned out it did not make much of a difference.

#3 lore raw
In reply to Fredrik Kuivinen
Quoted 12 lines · Fredrik Kuivinen
Quoted 10 lines · Junio C Hamano

I've made a few changes to "git blame" myself:

- fix breakage caused by recent revision walker reorganization;
- use built-in xdiff instead of spawning GNU diff;
- implement -S <ancestry-file> like annotate does.

Depending on the density of changes, it now appears that blame is 10%-30% faster than annotate. I thought CVS emulator might be interested to give it a whirl..

Quoted 8 lines

Nice work!

There is another possible optimisation with respect to xdiff. Instead of producing the diff on the xdiff side and parsing the diff in blame.c, we could add another call back which just gets the relevant information from the hunk header. I don't know how much we would gain from this, but it might be worth a try.

If I can comment on this thread, I would like to note IMHO that given the differences in
languages (C vs Perl) and the use of almost the same algorithm, just a 10%-30% in speed difference between blame and annotate it means that any further optimization can gain little because the bottleneck is elsewhere.

And I think is in getting the revision's history. Call it git-rev-list, although both
blame and annotate use directly the library revision.h

After the new xdiff merge, git-rev-list accounts for almost whole the time. Normally more then 80% in qgit.

Although the qgit annotation algorithm is different from both blame and annotate I think
that a faster git-rev-list <path> or revison history walker as you may want to call it it's a key
in really speed-up annotation stuff.

Marco

#4 lore raw
In reply to Junio C Hamano
Quoted 9 lines · Junio C Hamano

I've made a few changes to "git blame" myself:

- fix breakage caused by recent revision walker reorganization;
- use built-in xdiff instead of spawning GNU diff;
- implement -S <ancestry-file> like annotate does.

Depending on the density of changes, it now appears that blame is 10%-30% faster than annotate. I thought CVS emulator might be interested to give it a whirl..

Sorry, forgot to mention... The updated blame will be in "next", not in "master" yet.