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 21:24:18 +0300 Message-ID: References: <48BD9EA0.60608@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1220466288 16651 80.91.229.12 (3 Sep 2008 18:24:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 18:24:48 +0000 (UTC) Cc: flitterio@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 03 20:25:42 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 1Kax2l-0006yv-8b for ged-emacs-devel@m.gmane.org; Wed, 03 Sep 2008 20:25:27 +0200 Original-Received: from localhost ([127.0.0.1]:53262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kax1l-0004HY-D3 for ged-emacs-devel@m.gmane.org; Wed, 03 Sep 2008 14:24:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kax1h-0004HN-LN for emacs-devel@gnu.org; Wed, 03 Sep 2008 14:24:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kax1g-0004Gj-1L for emacs-devel@gnu.org; Wed, 03 Sep 2008 14:24:20 -0400 Original-Received: from [199.232.76.173] (port=41884 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kax1f-0004Ga-Ti for emacs-devel@gnu.org; Wed, 03 Sep 2008 14:24:19 -0400 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:46316) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kax1f-0000v8-BZ for emacs-devel@gnu.org; Wed, 03 Sep 2008 14:24:19 -0400 Original-Received: from HOME-C4E4A596F7 ([84.229.211.50]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K6M005QKTTMDIN0@i_mtaout2.012.net.il> for emacs-devel@gnu.org; Wed, 03 Sep 2008 21:24:59 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-kernel: by monty-python.gnu.org: Solaris 9.1 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:103511 Archived-At: > From: Stefan Monnier > Cc: Francis Litterio , emacs-devel@gnu.org > Date: Wed, 03 Sep 2008 10:30:24 -0400 > > > 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. > > Making it lazier is probably a good idea, but if the info will > eventually be needed anyway, maybe we should also eagerly featch this > info (asynchronously). After all, even a 10s delay is quite noticeable. The problem is that most callers of `stat' don't need most of the info in `struct stat'. This is a system call on Posix platforms, and it is very fast, so Emacs calls it indiscriminately. A much better way would be to abstract several popular uses of `stat' ("does the file exist?", "is the file executable?", etc.), and then implement that in the most efficient way on every supported platform. But I guess such refactoring will have to wait for some rainy day. The only Emacs primitives that _really_ need all of the info in `struct stat' are `file-attributes' and `directory-files-and-attributes'.