After upgrading emacs from 24.4 to 26.3 on Windows, everything works fine except for one thing: the list-packages
window has become horribly slow. Like, the cursor moves one second after the keystroke.
I have upgraded all packages (despite the sluggishness of the interface) and also tried (byte-recompile-directory "~/.emacs.d/elpa" 0 t)
but the situation has not improved.
Any idea?
These are the profiler's results (entered list-packages and moved the cursor around a bit):
- command-execute 140 71%
- call-interactively 140 71%
- funcall-interactively 94 47%
- execute-extended-command 47 23%
- sit-for 46 23%
redisplay 45 22%
- command-execute 1 0%
- call-interactively 1 0%
- funcall-interactively 1 0%
- profiler-report 1 0%
- profiler-report-cpu 1 0%
profiler-cpu-profile 1 0%
- next-line 47 23%
- line-move 47 23%
line-move-visual 46 23%
- byte-code 46 23%
- read-extended-command 46 23%
- completing-read 46 23%
- completing-read-default 46 23%
read-from-minibuffer 46 23%
+ ... 57 28%
...after a bit of bisecting my .emacs, I've found that the offending line is this one:
(set-face-attribute 'default nil :height 120 :family "Inconsolata" :foundry "outline"))
if I remove this, list-packages is back to normal. But why? Also, I like Inconsolata :-)
Meanwhile I've also discovered that org-mode becomes very slow if unicode symbols are visible (but not if they are hidden inside a collapsed headline); I suspect this is related.
list-packages
buffer, then typeM-x profiler-start RET cpu RET
and spend a short while doing (only) the things which are slow, thenM-x profiler-report RET
andC-u RET
to expand the results. Copy and paste that back into the question.M-x profiler-stop
to stop it from gathering more data, andM-x profiler-reset
to purge the existing data.M-x
activity (which seems expensive for some reason). I'm not sure if that was entirely due toM-x profiler-report
, but you might try to eliminate that (perhaps bind a key toprofiler-report
). Be sure toprofiler-reset
before gathering data. Otherwise, see whether disablingC-h v line-move-visual
has any noticeable effect on performance?(setq inhibit-compacting-font-caches t)
help? I'm asking because this happened a few days ago: git.savannah.gnu.org/cgit/emacs.git/commit/etc/… and the variable was introduced in 25.2, and you're coming from 24.4; so it seems worth testing.(setq inhibit-compacting-font-caches t)
solves the problem. thanks!