From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs 23.0 is much slower starting than Emacs 22.3 Date: Sat, 25 Oct 2008 11:19:28 -0400 Message-ID: References: <20081022091136.GB924@muc.de> <20081022151444.GE924@muc.de> <48FF58FB.6000302@harpegolden.net> <20081022211202.GA1037@muc.de> <49001F5A.7040402@harpegolden.net> <20081023090908.GB2666@muc.de> <4900ACF9.7060501@harpegolden.net> <4900FF17.2000203@harpegolden.net> <49011336.10307@harpegolden.net> <4901E787.40504@harpegolden.net> <49025DF8.6030502@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224948001 2639 80.91.229.12 (25 Oct 2008 15:20:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2008 15:20:01 +0000 (UTC) Cc: acm@muc.de, Eli Zaretskii , Lennart Borgman , emacs-devel@gnu.org To: David De La Harpe Golden Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 25 17:21:01 2008 connect(): Connection refused 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 1Ktkwh-0007vO-FW for ged-emacs-devel@m.gmane.org; Sat, 25 Oct 2008 17:20:55 +0200 Original-Received: from localhost ([127.0.0.1]:58566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktkvb-0005iA-G3 for ged-emacs-devel@m.gmane.org; Sat, 25 Oct 2008 11:19:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KtkvV-0005i5-D7 for emacs-devel@gnu.org; Sat, 25 Oct 2008 11:19:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KtkvU-0005ht-39 for emacs-devel@gnu.org; Sat, 25 Oct 2008 11:19:41 -0400 Original-Received: from [199.232.76.173] (port=41120 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtkvT-0005hq-VL for emacs-devel@gnu.org; Sat, 25 Oct 2008 11:19:40 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:36044 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KtkvQ-00054L-2H; Sat, 25 Oct 2008 11:19:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAFrVAklFxLrB/2dsb2JhbACBdr8Ig0+BDQ X-IronPort-AV: E=Sophos;i="4.33,484,1220241600"; d="scan'208";a="28854787" Original-Received: from 69-196-186-193.dsl.teksavvy.com (HELO pastel.home) ([69.196.186.193]) by ironport2-out.teksavvy.com with ESMTP; 25 Oct 2008 11:19:28 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 190998E6C; Sat, 25 Oct 2008 11:19:28 -0400 (EDT) In-Reply-To: <49025DF8.6030502@harpegolden.net> (David De La Harpe Golden's message of "Sat, 25 Oct 2008 00:44:56 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:104989 Archived-At: >> Setting vc-handled-backends to nil should indeed stop VC from doing >> those directory walks. So now I don't understand why the walks done by >> VC are so much cheaper than the ones done by locate-dominating-file. >> Could it be that all the files you opened were under CVS control (so >> the VC search stops before having to walk up the directories)? > Eventually found vc-find-root. So - it versus locate-dominating-file ? > While they're doing a fairly similar job, they do look to me like they're > implemented importantly differently -locate-dominating-file takes a regex > and passes it to directory-files for each directory. AFAICS directory-files > scans the whole directory each time through for the match. OTOH, > vc-find-root just tests if /path/to/directory/witness exists. The former is > rather slower and (I think) consier. I'm not sure that there's any real > performance problem with directory-files itself for what it actually does, > though maybe it could be made faster. Maybe not worthwhile though - easier > to rewrite locate-dominating-file to not use it as below... Thanks for you investigative work. locate-dominating-file used a regexp for searches for multiple files (e.g. I intended to merge the N calls to vc-find-root into a single call to locate-dominating-file), but from your measurements, it seems that unless we're searching for an open-ended set of files we're better off with multiple calls to vc-find-root, so I think we should indeed change locate-dominating-file to use a fixed name. This will also have the advantage that we should be able to use it directory for VC and hence get rid of vc-find-root. I've installed a change which should do just that. Stefan