0

When I'm pressing C-p/n moving the cursor around, the redisplaying is quite lagging. A profile of CPU give

+ command-execute                                                 527  59%
- redisplay_internal (C function)                                 264  29%
 - eval                                                           259  29%
  - if                                                            254  28%
     abbreviate-file-name                                         187  21%
   + and                                                           35   3%
   + format                                                        26   2%
  + replace-regexp-in-string                                        2   0%
   file-remote-p                                                    3   0%
+ ...                                                              61   6%
+ timer-event-handler                                              17   1%
+ sp--save-pre-command-state                                        7   0%
+ lsp-ui-sideline                                                   3   0%
  sp--post-command-hook-handler                                     1   0%
+ delete-space-base-on-indentation                                  1   0%
+ lsp--on-auto-save                                                 1   0%

Seems abbreviate-file-name(21%~29%) when redisplaying(29%~41%) ate quite a lot resources. But I have no idea how to fix this and I can't find when the call is. The issue only happens in c/c++ mode, while python-mode works quite well.

Updated:

A longer run

- redisplay_internal (C function)                                1369  41%
 - eval                                                          1364  41%
  - if                                                           1203  36%
     abbreviate-file-name                                         970  29%
   + and                                                          129   3%
   + format                                                       104   3%
  + let*                                                          160   4%
 + #<compiled 0x4203f303>                                           4   0%
+ command-execute                                                 829  25%
- timer-event-handler                                             668  20%
 - apply                                                          668  20%
  + semantic-idle-scheduler-function                              514  15%
  + jit-lock-stealth-fontify                                      105   3%
  + sp-show--pair-function                                         18   0%
    auto-revert-buffers                                            16   0%
  + savehist-autosave                                               9   0%
  + which-func-update                                               3   0%
  + show-paren-function                                             1   0%
+ ...                                                             375  11%
+ sp--save-pre-command-state                                       29   0%
+ lsp--on-auto-save                                                 6   0%
  tooltip-hide                                                      2   0%
  hl-line-maybe-unhighlight                                         1   0%
+ lsp-ui-sideline                                                   1   0%
+ hl-line-highlight                                                 1   0%
+ delete-selection-pre-hook                                         1   0%
  company-post-command                                              1   0%
  • Please record a longer run, this doesn't have enough samples to tell what's actually the problem. – wasamasa Feb 5 '18 at 6:53
  • My guess is that abbreviate-file-name is from something in mode-line-format. – npostavs Feb 5 '18 at 13:26
  • @npostavs I'm using powerline and I try to use plain emacs mode line with only which-func is displaying , the issue is still there. Here's mode-line-format: ("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces) . – stackunderflow Feb 6 '18 at 1:49

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.