From: Lin Sun <sunlin7.mail@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>,
acorallo@gnu.org, 41646@debbugs.gnu.org, stefankangas@gmail.com,
monnier@gnu.org
Subject: bug#41646: Startup in Windows is very slow when load-path contains many
Date: Fri, 1 Nov 2024 16:56:59 +0000 [thread overview]
Message-ID: <CABCREdoxj5y6muXX5vSAbcCRysu1a3EqXLS9kXToeHrJux+aVA@mail.gmail.com> (raw)
In-Reply-To: <jwvwmhnds9y.fsf-monnier+emacs@gnu.org>
On Fri, Nov 1, 2024 at 8:17 AM Eli Zaretskii <eliz@gnu.org> wrote:
> ...
> How will the '"file1" "file2" ...' part be created?
For the Emacs built in paths, we can create the (<path> [files])
during bootstrap and write to the "subdirs.el", then it will push the
extended (<path>, files...) into `load-path'.
On Fri, Nov 1, 2024 at 1:11 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > Yes, introducing this new variable will increase the complexity to the
> > end user.
>
> Exactly, and I think we should first try to solve the problem without
> exposing the user to such complexity.
> ...
> >> and then `load` can use `load-prefix-trim-load-path` to iterate on
> >> a much shorter `load-path`.
>
> Note that this above proposal should be transparent to the end user (tho
> it requires extra work on the `package.el` side): e.g. funny changes
> to `load-path` would be handled without fuss.
>
> >> I'm not completely sure if it's a good idea, tho: I'd really prefer
> >> a solution that doesn't require any change to any package management
> >> code, which instead uses a cache (updated/filled automatically) of all
> >> the files found in all the `load-path` directories.
> > If that, we have to track the file/path changes in each entry of
> > load-path, it may not be possible for all the supported OSs.
>
> We can easily detect changes to `load-path` itself, of course, but as
> for changes to the content of the directories in `load-path` that would
> be more difficult&costly, admittedly. My plan was to do nothing
> about it (i.e. allow the cache to go stale): if we use the cache only to
> tell `load` in which directory to look for the file, it should usually
> be safe because IME it's rare for files to be added/removed from
> directories such that it changes from which directory a given ELisp file
> is loaded. But of course we could also make efforts to try and keep our
> cache consistent, e.g. via OS-level notification infrastructure or
> by flushing the cache after a N seconds.
Agree the changes are difficult and costly.
The inotify way is hard to work on all OSes, and the cache need very
carefully maintenance policy.
next prev parent reply other threads:[~2024-11-01 16:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CABCREdrcJL1xfhB4NFW-WWRDd2ucMj_rVRTGZw1FqLHJHJFaQg@mail.gmail.com>
[not found] ` <86jzedy84g.fsf@gnu.org>
[not found] ` <CABCREdq4JXaJbQwsS9=MWEzYnOAr2CZCCvg6pjjyNEgZO-MZrg@mail.gmail.com>
[not found] ` <CABCREdosvZSGgwrU8bvVtCzK+P0aX3ACCeTDqQXyg+6xhFXzkw@mail.gmail.com>
[not found] ` <86r08luqsq.fsf@gnu.org>
[not found] ` <CABCREdqtUisaCsV4=-nc7wNJ3P5Z_43yPXrYH1ZwWPGOQuptsw@mail.gmail.com>
[not found] ` <86frp1unvu.fsf@gnu.org>
[not found] ` <CABCREdp2Ug_wgnj=w=bS-XiYESp6D4Cr4aE2G2wBHTwAttZ=9Q@mail.gmail.com>
[not found] ` <86y12stv24.fsf@gnu.org>
[not found] ` <CABCREdogicz4OKd0ORAtD_u2Q9HdLSt+DFs9pTqUQ1gcWGFdYg@mail.gmail.com>
2024-10-13 9:50 ` bug#41646: Startup in Windows is very slow when load-path contains many Stefan Kangas
2024-10-13 10:43 ` Eli Zaretskii
2024-10-13 14:47 ` Lin Sun
2024-10-13 15:24 ` Eli Zaretskii
2024-10-13 15:43 ` Lin Sun
2024-10-13 15:56 ` Eli Zaretskii
2024-10-13 16:03 ` Lin Sun
2024-10-13 16:39 ` Eli Zaretskii
2024-10-16 7:51 ` Lin Sun
2024-10-21 4:09 ` Lin Sun
2024-10-21 14:34 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-21 17:11 ` Lin Sun
2024-10-31 15:04 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-01 7:18 ` Lin Sun
2024-11-01 7:49 ` Lin Sun
2024-11-01 8:17 ` Eli Zaretskii
2024-11-01 13:11 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-01 16:56 ` Lin Sun [this message]
2024-11-01 17:08 ` Eli Zaretskii
2024-11-01 17:58 ` Lin Sun
2024-11-01 18:15 ` Lin Sun
2024-11-01 19:17 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-01 19:30 ` Lin Sun
2024-10-21 19:53 ` Lin Sun
2024-10-13 15:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=CABCREdoxj5y6muXX5vSAbcCRysu1a3EqXLS9kXToeHrJux+aVA@mail.gmail.com \
--to=sunlin7.mail@gmail.com \
--cc=41646@debbugs.gnu.org \
--cc=acorallo@gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=stefankangas@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).