1

Trying to figure out why find-file (C-x C-f) operations are taking a long time on Windows 10 with emacs 26.3. I tried to do profiling and got following results.

- command-execute                           74  84%
 - call-interactively                       74  84%
  - byte-code                               50  56%
   - read-extended-command                  33  37%
    - completing-read                       33  37%
     - completing-read-default              33  37%
      - read-from-minibuffer                26  29%
       + fci-redraw-frame                    3   3%
       + redisplay_internal (C function)     1   1%
       + linum-update-current                1   1%
   - find-file-read-args                    17  19%
    - read-file-name                        17  19%
     - read-file-name-default               17  19%
      - completing-read                     17  19%
       - completing-read-default            17  19%
        - read-from-minibuffer              12  13%
         + linum-update-current              3   3%
         + fci-redraw-frame                  3   3%
         + redisplay_internal (C function)   1   1%
  - funcall-interactively                   24  27%
   - find-file                              21  23%
    - pop-to-buffer-same-window             11  12%
     - pop-to-buffer                        11  12%
      - display-buffer                      11  12%
       - display-buffer-same-window         11  12%
        - window--display-buffer            11  12%
         - set-window-buffer                11  12%
          + linum-update-current             7   7%
          + fci-redraw-frame                 3   3%
          + linum-after-scroll               1   1%
    - find-file-noselect                    10  11%
     - find-file-noselect-1                  9  10%
      - after-find-file                      8   9%
       - normal-mode                         8   9%
        + run-hooks                          4   4%
        + set-auto-mode                      4   4%
      + normal-backup-enable-predicate       1   1%
     + find-buffer-visiting                  1   1%
   + execute-extended-command                3   3%
+ ...                                        8   9%
+ linum-update-current                       6   6%

However, I am not an expert in reading these reports. I am not exactly sure how to go from here. Can someone help?

  • 1
    How about getting rid of line numbers generated by Lisp and use the built-in line numbers instead? I.e., Use display-line-numbers-mode and forget about linum.el ... The built-in line numbers are generated at light speed and are woven into the display engine itself. – lawlist Nov 19 at 23:36
  • 1
    Which part(s) of the entire interactive process feel slow to you? (e.g. is it the time from typing C-x C-f to being able to type a filename? Is it the time from submitting a filename to being able to edit the buffer? etc...) – phils Nov 19 at 23:37
  • 1
    Do you see the same slowness when starting Emacs with emacs -Q ? – phils Nov 19 at 23:38
  • @lawlist I tried changing that. It is still slow. But thanks for this input. – Nullpointer Nov 22 at 22:12
  • @phils Its the time from submitting a filename until any text is shown in the buffer. Basically the buffer still shows the old text for a long time after hitting enter on the filename. And I tried with emacs -Q too but it still shows the same slow behavior. – Nullpointer Nov 22 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.