[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: |
Eli Zaretskii |
Subject: |
bug#41646: Startup in Windows is very slow when load-path contains many entries. |
Date: |
Mon, 01 Jun 2020 19:05:58 +0300 |
> From: Nicolas Bértolo <nicolasbertolo@gmail.com>
> Date: Mon, 1 Jun 2020 11:26:35 -0300
>
> I have an issue regarding startup times in Windows. My configuration is
> Spacemacs with many layers enabled. My load-path contains 380 entries.
>
> I have profiled Emacs in Windows and found that it spends most of the startup
> time calling wopen(). This is because when calling (load "foo") it checks all
> directories in load-path for ("foo.el" "foo.elc" "foo.el.gz" "foo.elc.gz"
> "foo.dll"). It gets worse when load-prefer-newer is t.
>
> In my case `load-path` contains 380 entries, so every call to load will
> perform
> 380 * 5 = 1900 calls to wopen. This is very slow in Windows because its
> filesystem is not optimized for so many accesses to small files.
So this is not specific to Windows, it's just that Windows has slower
file access. IOW, if load-path becomes significantly larger, the slow
startup will show on Posix systems as well, right?
Next question: are the 'wopen' calls coming from 'openp'? if so,
perhaps we could first try a cheaper call, like 'chmod' (or its Win32
API equivalent), and save the 'wopen' call if 'chmod' fails? Did you
try that?
> I thought that a caching mechanism would help.
My main concern with a cache is how to make sure it reflects what's on
the disk, when files are added or removed.
Thanks.