From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Nicolas Bértolo" <nicolasbertolo@gmail.com>
Cc: 41646@debbugs.gnu.org
Subject: bug#41646: Startup in Windows is very slow when load-path contains many entries.
Date: Fri, 14 Aug 2020 19:22:26 +0200 [thread overview]
Message-ID: <87r1s92ld9.fsf@gnus.org> (raw)
In-Reply-To: <CAFnS-Okkw3facctWKOfmYS9gSseD3c2=VYfw4tSyBrpZY_W5AA@mail.gmail.com> ("Nicolas Bértolo"'s message of "Tue, 2 Jun 2020 22:07:45 -0300")
Nicolas Bértolo <nicolasbertolo@gmail.com> writes:
>> Sorry, I meant 'access', of course. More accurately,
>> GetFileAttributes.
>
> That was a very good idea. The attached patch reduces time spent
> in openp() during startup by 5 seconds, or 15%.
That's a huge speed-up indeed.
[...]
> - fd = emacs_open (pfn, O_RDONLY, 0);
> + /* In some systems (like Windows) finding out if a
> + file exists is cheaper to do than actually opening
> + it. Only open the file when we are sure that it
> + exists. */
> +#ifdef WINDOWSNT
> + if (faccessat (AT_FDCWD, pfn, R_OK, AT_EACCESS))
> + fd = -1;
> + else
> +#endif
> + fd = emacs_open (pfn, O_RDONLY, 0);
> +
This is a Windows-specific patch, so I have no opinion on it. Eli?
Does this make sense to you?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2020-08-14 17:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 14:26 bug#41646: Startup in Windows is very slow when load-path contains many entries Nicolas Bértolo
2020-06-01 16:05 ` Eli Zaretskii
2020-06-01 16:46 ` Nicolas Bértolo
2020-06-01 17:17 ` Eli Zaretskii
2020-06-01 19:51 ` Nicolas Bértolo
2020-06-02 2:17 ` Eli Zaretskii
2020-06-03 1:07 ` Nicolas Bértolo
2020-08-14 17:22 ` Lars Ingebrigtsen [this message]
2020-08-14 19:07 ` Eli Zaretskii
2021-05-13 9:17 ` Lars Ingebrigtsen
2021-05-13 10:20 ` Eli Zaretskii
2021-05-13 11:31 ` Lars Ingebrigtsen
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=87r1s92ld9.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=41646@debbugs.gnu.org \
--cc=nicolasbertolo@gmail.com \
/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).