From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: CVS Emacs on Windows XP takes 60 seconds to start Date: Wed, 03 Sep 2008 06:25:18 +0300 Message-ID: References: <48BD9EA0.60608@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1220412357 6856 80.91.229.12 (3 Sep 2008 03:25:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 03:25:57 +0000 (UTC) Cc: emacs-devel@gnu.org To: Francis Litterio Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 03 05:26:51 2008 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 1Kaj17-00013f-9h for ged-emacs-devel@m.gmane.org; Wed, 03 Sep 2008 05:26:49 +0200 Original-Received: from localhost ([127.0.0.1]:50183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kaj07-0000Tt-Qo for ged-emacs-devel@m.gmane.org; Tue, 02 Sep 2008 23:25:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kaj03-0000TT-UL for emacs-devel@gnu.org; Tue, 02 Sep 2008 23:25:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kaj03-0000TA-0P for emacs-devel@gnu.org; Tue, 02 Sep 2008 23:25:43 -0400 Original-Received: from [199.232.76.173] (port=57211 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kaj02-0000T6-Mz for emacs-devel@gnu.org; Tue, 02 Sep 2008 23:25:42 -0400 Original-Received: from mtaout6.012.net.il ([84.95.2.16]:37227) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kaj01-0007nZ-2X for emacs-devel@gnu.org; Tue, 02 Sep 2008 23:25:41 -0400 Original-Received: from HOME-C4E4A596F7 ([84.229.211.50]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K6L0094FO7BWWI0@i-mtaout6.012.net.il> for emacs-devel@gnu.org; Wed, 03 Sep 2008 06:26:00 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 10 (1203?) 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:103477 Archived-At: > From: Francis Litterio > Date: Tue, 02 Sep 2008 17:50:59 -0400 > > > if (!(NILP (Vw32_get_true_file_attributes) > > || (EQ (Vw32_get_true_file_attributes, Qlocal) > > && devtype != DRIVE_FIXED && devtype != DRIVE_RAMDISK)) > > /* No access rights required to get info. */ > > && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, > > FILE_FLAG_BACKUP_SEMANTICS, NULL)) > > != INVALID_HANDLE_VALUE) > > > > to always evaluate to zero, thus bypassing the code in the block that > > follows the `if' clause and calls get_file_owner_and_group. > > Eli, > > I changed the above condition to: > > if (0) > > and rebuilt. The resulting emacs.exe starts immediately (both "emacs > -q" and "emacs -Q"), and there are no RPC calls made to any external > host when Emacs is starting. Thanks. I have one more request, assuming you can run Emacs under a debugger: with the above condition enabled (i.e. revert the code to what it is in the CVS), can you please verify that lookup_account_sid is called by `stat' exactly twice during startup: once for the user who owns the Emacs installation tree (probably you), and one more time for the primary group of that user. The rest of files that `stat' is called for should not cause a call to lookup_account_sid, but instead should get their user and group name and ID from the cache maintained by w32_add_to_cache and w32_cached_id. I'd like to make sure that the calls to lookup_account_sid are kept to their bare minimum, as intended, and that there's no bug in the code which handles that part. Beyond that, I intend to make changes in the code such that the file security information is requested only when the caller of `stat' really needs that. The absolute majority of `stat' calls during startup come from functions like `file-exists-p' and `load' (via `openp') that only need to know if the file exists and is a directory. I want to modify code so that Emacs doesn't even try to call lookup_account_sid on behalf of these callers. This should bring down the startup time even for situations such as yours, where a firewall blocks access to LDAP. Thanks for working on this.