0

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.

  • Open the `list-packages` buffer, then type `M-x profiler-start RET cpu RET` and spend a short while doing (only) the things which are slow, then `M-x profiler-report RET` and `C-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, and `M-x profiler-reset` to purge the existing data. – phils Sep 10 '19 at 23:36
  • It looks like you've profiled a lot of `M-x` activity (which seems expensive for some reason). I'm not sure if that was entirely due to `M-x profiler-report`, but you might try to eliminate that (perhaps bind a key to `profiler-report`). Be sure to `profiler-reset` before gathering data. Otherwise, see whether disabling `C-h v line-move-visual` has any noticeable effect on performance? – phils Sep 11 '19 at 11:05
  • @phils I think it's rather that the profile failed to pick up any significant activity, 140 is very low. For something noticeably slow to a human, I would expect thousands of samples. – npostavs Sep 11 '19 at 13:36
  • 2
    As you narrowed this to a font issue, and you're running on Windows, does `(setq inhibit-compacting-font-caches t)` help? I'm asking because this happened a few days ago: http://git.savannah.gnu.org/cgit/emacs.git/commit/etc/NEWS?id=f34f49f35e5c000a6ee070678f43d2ca38b76cad and the variable was introduced in 25.2, and you're coming from 24.4; so it seems worth testing. – phils Sep 11 '19 at 22:50
  • After some further reading I'm 99% sure that was the problem here. It seems that this is a rather complex issue generally, with numerous bug reports, OS-specific issues, and edge cases. On Windows inhibiting the font compaction code is the most important thing; but apparently having the `Symbola` font installed on your system *might* also provide some additional performance improvements in some situations. – phils Sep 12 '19 at 00:15
  • 2
    Yes! `(setq inhibit-compacting-font-caches t)` solves the problem. thanks! – Giovanni Gigante Sep 12 '19 at 11:15
  • 1
    I suggest that we close this as a duplicate of [unicode.txt slowness](https://emacs.stackexchange.com/questions/33510/unicode-txt-slowness) – phils Sep 13 '19 at 01:31

0 Answers0