unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: flitterio@gmail.com, emacs-devel@gnu.org
Subject: Re: CVS Emacs on Windows XP takes 60 seconds to start
Date: Wed, 03 Sep 2008 21:24:18 +0300	[thread overview]
Message-ID: <uprnl6qb1.fsf@gnu.org> (raw)
In-Reply-To: <jwvod35z4ko.fsf-monnier+emacs@gnu.org>

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: Francis Litterio <flitterio@gmail.com>, 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'.




  reply	other threads:[~2008-09-03 18:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 19:45 CVS Emacs on Windows XP takes 60 seconds to start Francis Litterio
2008-09-02 20:14 ` Lennart Borgman (gmail)
2008-09-02 20:16   ` Francis Litterio
2008-09-02 20:30     ` Eli Zaretskii
2008-09-02 20:55       ` Francis Litterio
2008-09-02 21:18         ` Francis Litterio
2008-09-02 21:19         ` Lennart Borgman (gmail)
2008-09-02 21:19       ` Eli Zaretskii
2008-09-02 21:50         ` Francis Litterio
2008-09-03  0:41           ` Francis Litterio
2008-09-03  0:57             ` Jason Rumney
2008-09-03  1:04               ` Francis Litterio
2008-09-03  3:04               ` Francis Litterio
2008-09-03  3:28             ` Eli Zaretskii
2008-09-03  3:25           ` Eli Zaretskii
2008-09-03 14:30             ` Stefan Monnier
2008-09-03 18:24               ` Eli Zaretskii [this message]
2008-09-03 18:40                 ` Stefan Monnier
2008-09-03 19:00                   ` Eli Zaretskii
2008-09-03 15:14             ` Francis Litterio
2008-09-03 18:19               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uprnl6qb1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=flitterio@gmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).