GNU bug report logs -
#19390
25.0.50; `package-activate' is too slow
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Mon, 15 Dec 2014 17:36:01 UTC
Severity: normal
Found in version 25.0.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
As for low-hanging fruits in `package--list-loaded-files', there are
two I can think of.
1. If `load-history' stored `file-truename's (relative to "/"),
instead of just absolute file names, then that would avoid a lot of
calls to `file-truename'. This, I suspect, is the bigger performance
issue.
2. Creating the `history' variable as below is a problem.
(mapcar (lambda (x) (file-name-sans-extension
(file-truename (car x))))
load-history)
This lambda is called a lot more times than necessary, because most
entries in load-history are useless here. But we need to do this to be
able to reliably compare file names. Ideally, there would be another
variable, like `load-history-truename', which is modified in parellel
with `load-history' and *only* stores the truename of files listed in
`load-history' (no need to store all that extra information). Then we
could just use this variable unmodified.
Implementing 2. would also fix 1.
2014-12-16 11:26 GMT-02:00 Artur Malabarba <bruce.connor.am <at> gmail.com>:
> I didn't notice anything as aggravating as the report, but I agree my
> latest patch is a performance concern.
>
> The proposed patch looks good, just a couple of notes:
>
> 1. I'd use RELOAD for the name of the optional argument.
> 2. Since this function now takes a second (somewhat non-trivial
> argument), we should add a docstring to it:
>
> "Activate package given by PKG-DESC, even if it was already active.
> If RELOAD is non-nil, also `load' any files inside the package which
> correspond to previously loaded files (those returned by
> `package--list-loaded-files').
>
> This is called internally by `package-activate'."
This bug report was last modified 10 years and 236 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.