emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#30854: 27.0.50; Speeding up package.el startup


From: Stefan Monnier
Subject: Re: bug#30854: 27.0.50; Speeding up package.el startup
Date: Mon, 21 Dec 2020 22:35:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Could this strategy work: "site-autoloads.el" is used just to create
> "user-autoloads.el" (I am just making up names, hope it is clear what I
> mean with them) on first start. User can now disable/enable whichever
> from sysadmin installed ones, as if they were present in users packages,
> and regenerate autoloads.el as the docs describe. Emacs checks mtime of
> site-autoloads.el and if it is changed it recreates new autoloads file
> with respect to disabled packages.

The code in package.el already handles the case I described.
What doesn't work yet is to automatically detect when
`package-quickstart.el` needs to be recreated.

> You mean to automate, so the user does not need to run
> package-quickstart-refresh manually?

Exactly.  That's what needs to happen before we can consider enabling
`package-quickstart` by default.

> It means Emacs would need to iterate all the directories in site
> packages and user packages somewhere at some time; probably in some
> idle timer function or do you have something else in mind?

To be correct, it needs to be done before we load
`package-quickstart.el`.

> If sysadmin updated site packages then autoloads for the site would

There's no such thing as "autoloads for the site" currently.
But I don't think we need to create that either.
Installing/removing/upgrading a package will change the mtime of the
parent directory (i.e. the directory that's in
`package-directory-list`), so we just need to check the mtime of
those directories.  While there can easily be hundreds of packages,
`package-directory-list` is usually a short list, holding typically less
than 5 elements, so it should not impact startup time noticeably.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]