[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41646: Startup in Windows is very slow when load-path contains many
From: |
Lars Ingebrigtsen |
Subject: |
bug#41646: Startup in Windows is very slow when load-path contains many entries. |
Date: |
Fri, 14 Aug 2020 19:22:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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
- bug#41646: Startup in Windows is very slow when load-path contains many entries.,
Lars Ingebrigtsen <=