]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/blame.c
blame: large-scale performance rewrite
authorDavid Kastrup <dak@gnu.org>
Fri, 25 Apr 2014 23:56:49 +0000 (01:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Apr 2014 21:38:15 +0000 (14:38 -0700)
commit7e6ac6e4391caa0fc379cb699013d503380e4214
tree646d4303e0e977fd7ff0742220a30abe2b9562e1
parent35936f8fc38a214cc7d2595070641d39a541dfb1
blame: large-scale performance rewrite

The previous implementation used a single sorted linear list of blame
entries for organizing all partial or completed work.  Every subtask had
to scan the whole list, with most entries not being relevant to the
task.  The resulting run-time was quadratic to the number of separate
chunks.

This change gives every subtask its own data to work with.  Subtasks are
organized into "struct origin" chains hanging off particular commits.
Commits are organized into a priority queue, processing them in commit
date order in order to keep most of the work affecting a particular blob
collated even in the presence of an extensive merge history.

For large files with a diversified history, a speedup by a factor of 3
or more is not unusual.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/blame.c