good-scroll.el
good-scroll.el copied to clipboard
Performance seems to be affected by the major-mode
I'd like to share some user experiences over the past few days of heavy coding on Emacs using this package: I realized that the scrolling performance seems to be affected by the major-mode. Specifically, programming modes (at least to my investigation) generally scroll with suboptimal performance in comparison to non-programming modes like text-mode or org-mode. I've tested it using the exact same buffer content, simply switching the modes with M-x c++mode
or M-x text-mode
etc.. Since I have several hooks added to programming modes, I initially wondered if it was something like "display-line-numbers-mode" or "font-lock-mode" that was causing the suboptimal performance. However, I manually disabled those minor modes to have a clean comparison and see no effect.
P.s. Suboptimal scrolling performance includes a lag between scrolling the mouse wheel and the actual scroll of the buffer. Also, sometimes the scrolling stops earlier than it's supposed to. P.p.s. I really appreciate your effort! To the extent that I even gave this package a shoutout on Reddit haha
@io12 I found the root cause! It's lsp-mode. With lsp-mode disabled, prog-modes can scroll as perfectly smooth as any other non-programming major mode. I've also found that "tree-sitter-hl-mode" also has to some degree an influence on performance, but still the main root cause is lsp-mode. I don't know where I should keep this issue at... as I'm not sure if this is solvable within good-scroll's scope. What do you think?
I'm not sure. You could try using Emacs's profiler to see what's slowing it down. I haven't had much time to work on good-scroll for the past few days, but I might be able to look into this more later.
I haven't had much time to work on good-scroll for the past few days, but I might be able to look into this more later.
Oh oh, no rush at all, I hope I don't come across as pressuring -- I just wanted to share my experience and see if something rings a bell. :-)
You could try using Emacs's profiler to see what's slowing it down
I'll try that and report back if I find anything.
I'm biased of course, but you might find https://github.com/aspiers/etrace useful for profiling. Personally I tried both elp.el
and profiler.el
, and found elp.el
in conjunction with these visualisations much more helpful.