Skip to content

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

Open
bcc32 wants to merge 1 commit into
abo-abo:masterfrom
bcc32:lv-window-no-redundant-fundamental-mode
Open

Do not call fundamental-mode if lv buffer is already in fundamental-mode#421
bcc32 wants to merge 1 commit into
abo-abo:masterfrom
bcc32:lv-window-no-redundant-fundamental-mode

Conversation

@bcc32

@bcc32 bcc32 commented Aug 6, 2024

Copy link
Copy Markdown

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
Copy Markdown

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