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

Do not call fundamental-mode if lv buffer is already in fundamental-mode #421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcc32
Copy link

@bcc32 bcc32 commented Aug 6, 2024

Actually calling the fundamental-mode function can be a bit slow,
because it involves running change-major-mode-hook and also doing a
mode-line redisplay. When the lv buffer is re-created over and
over, this can contribute to significant visual stuttering.

For example, in Spacemacs, pressing SPC w . (window transient state)
and then holding down } (enlarge) lags heavily before this change, but
is much smoother after.

Preserve the behavior of #364, however, to ensure that the lv buffer
is still in the correct major-mode.

Actually calling the fundamental-mode function can be a bit slow,
because it involves running change-major-mode-hook and also doing a
mode-line redisplay.  When the lv buffer is re-created over and
over, this can contribute to significant visual stuttering.

For example, in Spacemacs, pressing SPC w . (window transient state)
and then holding down } (enlarge) lags heavily before this change, but
is much smoother after.

Preserve the behavior of abo-abo#364, however, to ensure that the lv buffer
is still in the correct major-mode.
@fnussbaum
Copy link

This change seems to be a definite improvement and would be great to see merged.

It does make a difference on my system, though the example of resizing windows in Spacemacs still stutters quite a bit for me. This is probably due to a combination of a relatively old CPU, a high key repeat rate, and non-trivial members in the relevant hooks. I had investigated the same underlying performance problem with the scroll transient state in Spacemacs and came up with this workaround: #422

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

Successfully merging this pull request may close these issues.

2 participants