From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Progress report on git-blame Date: Sat, 25 Jan 2014 09:59:33 +0100 Message-ID: <87vbx8cu8a.fsf@fencepost.gnu.org> References: <20140109140226.57D6C38085A@snark.thyrsus.com> <20140110155121.GA8178@thyrsus.com> <20140111205925.GC17111@thyrsus.com> <87y52mdoha.fsf@fencepost.gnu.org> <87fvoceuos.fsf_-_@fencepost.gnu.org> <83d2jgcy5z.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390640390 18005 80.91.229.3 (25 Jan 2014 08:59:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jan 2014 08:59:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 25 09:59:58 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W6z5n-0005Lk-9E for ged-emacs-devel@m.gmane.org; Sat, 25 Jan 2014 09:59:55 +0100 Original-Received: from localhost ([::1]:50368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6z5m-0002yX-DK for ged-emacs-devel@m.gmane.org; Sat, 25 Jan 2014 03:59:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6z5j-0002xm-LD for emacs-devel@gnu.org; Sat, 25 Jan 2014 03:59:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6z5h-0004uH-L7 for emacs-devel@gnu.org; Sat, 25 Jan 2014 03:59:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6z5h-0004u5-Hc for emacs-devel@gnu.org; Sat, 25 Jan 2014 03:59:49 -0500 Original-Received: from localhost ([127.0.0.1]:48121 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6z5g-0005FN-Vo; Sat, 25 Jan 2014 03:59:49 -0500 Original-Received: by lola (Postfix, from userid 1000) id C97F5E0725; Sat, 25 Jan 2014 09:59:33 +0100 (CET) In-Reply-To: <83d2jgcy5z.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Jan 2014 09:34:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169048 Archived-At: Eli Zaretskii writes: >> From: David Kastrup >> Date: Sat, 25 Jan 2014 02:06:43 +0100 >> >> my current code (which is not ready for submission as it does not >> support all options of git-blame yet) takes 2 seconds for the git-blame >> step as opposed to the 40 seconds the system binary does. That's at >> least encouraging and one can expect some of that to be pure output >> time. > > Thank you for doing this. Well, I finally did "git gc --aggressive" on my Emacs repository and tried again git-blame src/xdisp.c and the times got considerably _worse_ than before the packing (though the repository went to about a quarter in size). So after my fixes the run time in real use cases is probably dominated by unpacking the various revisions, particularly with a well-compressed repository. The positive thing about it is that fixing the blame algorithm will make the remaining culprits stand out more prominently when profiling. The downside, of course, is that I had not been banking on having to rework more than the blame algorithm itself to move C-x v g into the "tolerable" area. [system version] dak@lola:/usr/local/tmp/emacs$ time git blame src/xdisp.c >/dev/null real 3m5.786s user 2m21.168s sys 0m43.956s [my version] dak@lola:/usr/local/tmp/emacs$ time ../git/git blame src/xdisp.c >/dev/null real 2m11.865s user 1m13.372s sys 0m57.656s I am currently using commit time for prioritizing a breadth-first search exhausting all later commits before going to previous revisions. That may result in worse object retainment patterns for the unpacking stage while walking backwards in history. Apart from trying to bully up general git performance and from trying to get the unpacking to cache smarter, it would also be feasible to add a "fast track" interface to git blame --interactive where Emacs sends information about "currently viewed material corresponds to lines xxx...yyy in the file" to the running git process which is used for prioritizing the outstanding work. That would be reasonably doable from the git side, but of course it would require additional support from vc-git. I did that kind of thing in preview-latex (an in-document viewing mode available in AUCTeX) for being able to work with large files and four-figure amounts of included graphics while rendering all the graphics with GhostScript on a 200MHz CPU. It has sort of an xroach-like effect where everything looks calm and finished until you try scrolling around in the document. While that stuff does not help with non-interactive use like M-x occur, it should be useful even for incremental search as long as the search concerns the _meat_ of the lines rather than the blame info. But I definitely don't have the time to work on the Emacs component of that sort of thing myself. -- David Kastrup