Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we reduce the frequency of redisplay execution? #919

Closed
eval-exec opened this issue Apr 26, 2024 · 4 comments
Closed

Can we reduce the frequency of redisplay execution? #919

eval-exec opened this issue Apr 26, 2024 · 4 comments

Comments

@eval-exec
Copy link
Contributor

When I opened a C code:

  1. start profiler-start
  2. long press keyboard down
  3. profiler-report

When pressing the down key, I can feel a sluggishness and notice that redisplay is consuming a lot of CPU.

Is there a way for us to reduce the frequency of redisplay execution?

        1444  79% - lsp-bridge-monitor-post-command
        1443  79%  - let
        1443  79%   - if
        1387  76%    - progn
        1387  76%     - if
        1213  66%      - progn
        1213  66%       - redisplay
        1207  66%        - redisplay_internal (C function)
          59   3%         + eval
          13   0%         + #<advice C88>
           1   0%         + jit-lock-function
         171   9%      + if
           1   0%        string-prefix-p
           1   0%        lsp-bridge-diagnostic-hide-tooltip
          56   3%    + lsp-bridge-has-lsp-server-p
           1   0%  + set
         155   8% + redisplay_internal (C function)
          80   4% + #<closure E11>
          73   4% + command-execute
          26   1% + display-line-numbers-update-width
           6   0% + timer-event-handler
           5   0% + gcmh-register-idle-gc
           4   0% + evil-repeat-post-hook
           3   0% + winner-save-old-configurations
           3   0% + yas--post-command-handler
           2   0%   magit-pre-command-hook
           2   0%   evil--jump-handle-buffer-crossing
           2   0%   cursor-sensor--detect
           2   0% + lsp-bridge-monitor-window-buffer-change
           1   0% + indent-bars--highlight-current-depth
           1   0%   telega--check-buffer-switch
           1   0%   clear-minibuffer-message
           1   0% + internal-timer-start-idle
           1   0%   gcmh-set-high-threshold
           0   0%   ...
@manateelazycat
Copy link
Owner

inlay hint feature need window-start to fetch start point of current window.

window-start will failed if redisplay is not call first.

I will research window-start source code and try to remove redisplay.

@eval-exec
Copy link
Contributor Author

eglot use jit-lock to support inlay hints: https://github.com/joaotavora/eglot/blob/db91d58374627a195b731a61bead9b4f84a7e4bc/eglot.el#L3883-L3892

I don't know if this is a better solution.

manateelazycat added a commit that referenced this issue Apr 27, 2024
…ce the call number of `redisplay` function
@manateelazycat
Copy link
Owner

I have push commit 386ac48

Can you upgrade to newest version and try again?

@manateelazycat
Copy link
Owner

Please re-open this issue if still have problem after upgrade to newest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants