From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexandru Harsanyi Newsgroups: gmane.emacs.devel Subject: Re: Hideously slow VC status queries fixed Date: Thu, 27 Dec 2007 15:13:33 +0900 Message-ID: <39B013FE-1ED8-4665-A22C-1EFD293BF7EA@mac.com> References: <20071227001113.3EDFE830B6E@snark.thyrsus.com> <200712270241.lBR2fAjv018571@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1198736145 18125 80.91.229.12 (27 Dec 2007 06:15:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2007 06:15:45 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 27 07:15:58 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J7m26-0000HI-A1 for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 07:15:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7m1j-0005O7-HC for ged-emacs-devel@m.gmane.org; Thu, 27 Dec 2007 01:15:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J7m1d-0005Mr-5d for emacs-devel@gnu.org; Thu, 27 Dec 2007 01:15:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J7m1b-0005Kk-33 for emacs-devel@gnu.org; Thu, 27 Dec 2007 01:15:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7m1a-0005KS-RJ for emacs-devel@gnu.org; Thu, 27 Dec 2007 01:15:22 -0500 Original-Received: from hosted01.westnet.com.au ([203.10.1.211]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J7m1a-0000Ym-Cd for emacs-devel@gnu.org; Thu, 27 Dec 2007 01:15:22 -0500 Original-Received: from hosted01.westnet.com.au (hosted01.westnet.com.au [127.0.0.1]) by hosted01.westnet.com.au (Postfix) with SMTP id 864EDE0045 for ; Thu, 27 Dec 2007 15:13:33 +0900 (WST) Original-Received: from [10.0.1.4] (dsl-58-7-169-97.wa.westnet.com.au [58.7.169.97]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by hosted01.westnet.com.au (Postfix) with ESMTP id CA31CE003F for ; Thu, 27 Dec 2007 15:13:32 +0900 (WST) In-Reply-To: <200712270241.lBR2fAjv018571@oogie-boogie.ics.uci.edu> X-Mailer: Apple Mail (2.753) X-PMX-Branch: TNG-Outgoing X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85498 Archived-At: On 27 Dec 2007, at 11:41 AM, Dan Nicolaescu wrote: > "Eric S. Raymond" writes: > >> It gives me great pleasure to be able to announce that I have found, >> and fixed, the bug that made C-x v d so godawful much slower than the >> underlying commands. > > Thank you so much for doing this! > > There's still one source of inefficiency: files that are not vc- > registered > at all. For example object files in a build tree. > > Try this: > > cd emacs/lisp/term (because it is a small subdir) > > for FF in `seq 1 1000`; do touch obj${FF}.o; done > > (just create 1000 .o files) > > emacs -q > M-x elp-instrument-package RET vc RET > C-x v d emacs/lisp/term RET > M-x elp-results RET > > That will show 1000 calls to vc-bzr-registered, vc-git-registered, > vc-arch-registered, vc-svn-registered etc etc. One way to reduce the number of calls is to use the `vc-BACKEND- responsible-p' functions to determine which backends are responsible for files in a directory. It will than only call the `vc-BACKEND- registered' function for the responsible backends only. The speed of the vc-BACKEND-registered call be improved by having the `vc-BACKEND-dir-state' function set a property meaning 'not- registered' for every file that is not registered with that BACKEND. vc-BACKEND-registered will than check for that property before invoking the BACKEND command. Best Regards, Alex.