all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Stefan Kangas <stefankangas@gmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: bug#30854: 27.0.50; Speeding up package.el startup
Date: Tue, 22 Dec 2020 12:03:41 +0100	[thread overview]
Message-ID: <AM0PR06MB6577F3C816D1F8FDA89E853696DF0@AM0PR06MB6577.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <jwvk0ta8qqc.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 21 Dec 2020 22:35:04 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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.
Yes, I know. That was a proposal to structure it that way; also to
introduce site-autoloads.el for potential sysadmins. Similar to
site-start/load/init.el.

> 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.
Indeed; we are on same page there.

What I was thinking of was that autoloads would be generated when
packages are updated anyway, so checking just mtime for that file is
synonymous to checking directories in that list. Discovering change is
only needed for site installed packages. If there existed one central
autoload in system elpa directory, then autoloads for all those packages
would be calculated only once: when sysadmin update packages. User Emacs
could just check that file, and if it is newer then some last time stamp,
simply update the user autoloads. But what I am thinking of now is
that sysadmin my mount storage locations under different path than how
it is mounted for a user; so site autoloads would need to be emited with
relative paths, while user's would need to be absolute and updated when
user file is generated. Not hard but but I scratch the idea if there is
extra work performed anyway. Just check mtime of the repo directory,
and generate new user autoloads; works just fine too :-). 

For the user directories there is no need to check them, since autoloads
file would be touched automatically when packages are updated.

I have come up to think of a thing when quickstart is creating
autoloads. It currently loops through all packages avialable and
generates autoloads for them all, and adds them all to the path, it does
not seem to care about what user activated or not, at least how I
understand package-quickstart-refresh function.

If there was a blacklist of some kind, then it could be checked when
autoloads file is created and those packages simply not emitted to
autoloads so emacs does not read them on the start, or do I
missunderstand how active/inactive packages works? I think it would be
needed if user is to disable site installed packages.




  reply	other threads:[~2020-12-22 11:03 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 10:56 bug#30854: 27.0.50; Speeding up package.el startup arthur.miller
2020-12-18 15:02 ` Stefan Monnier
2020-12-18 16:05   ` arthur.miller
2020-12-18 16:37     ` Stefan Monnier
2020-12-18 22:58       ` Basil L. Contovounesios
2020-12-18 23:26         ` Stefan Monnier
2020-12-19 16:34       ` arthur.miller
2020-12-19 17:59         ` Stefan Monnier
2020-12-19 18:23           ` Stefan Kangas
2020-12-19 20:56             ` Stefan Monnier
2020-12-20  2:47               ` Pankaj Jangid
2020-12-20 14:23               ` Arthur Miller
2020-12-20 14:52                 ` Stefan Monnier
2020-12-20 15:13                   ` Arthur Miller
2020-12-20 17:16                     ` Stefan Monnier
2020-12-20 22:23                       ` arthur miller
2020-12-20 23:35                       ` arthur miller
2020-12-20 23:44                         ` Stefan Monnier
2020-12-20 23:46                           ` arthur miller
2020-12-21 16:32                           ` Arthur Miller
2020-12-21 17:11                             ` Stefan Kangas
2020-12-21 17:32                               ` Arthur Miller
2020-12-21 18:16                                 ` Arthur Miller
2020-12-21 18:58                                   ` Stefan Monnier
2020-12-21 19:51                                     ` Arthur Miller
2020-12-21 18:31                                 ` Stefan Monnier
2020-12-21 19:45                                   ` Arthur Miller
2020-12-21 20:03                                     ` Stefan Monnier
2020-12-21 20:58                                       ` Arthur Miller
2020-12-21 22:14                                         ` Stefan Monnier
2020-12-21 23:15                                           ` Arthur Miller
2020-12-22  3:35                                             ` Stefan Monnier
2020-12-22 11:03                                               ` Arthur Miller [this message]
2020-12-22 14:50                                                 ` Stefan Monnier
2020-12-22 16:55                                                   ` Arthur Miller
2020-12-22 17:20                                                     ` Stefan Monnier
2020-12-22 18:24                                                       ` Arthur Miller
2020-12-22 19:44                                                         ` Stefan Monnier
2020-12-22 20:45                                                           ` Arthur Miller
2020-12-20 23:45                       ` arthur miller
2020-12-19 21:12             ` arthur miller
2020-12-19 21:16             ` arthur miller
  -- strict thread matches above, loose matches on Subject: below --
2018-03-19 14:26 Stefan Monnier
2018-03-26 13:42 ` Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM0PR06MB6577F3C816D1F8FDA89E853696DF0@AM0PR06MB6577.eurprd06.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.