Fork me on GitHub

Wanna see something weird? I just ran my profiler with a stripped down spacemacs config. Scrolling down takes a lot more cpu time than scrolling up. What could be the reason for this?


Is there any way to profile at a lower level? Need some more detail as to what’s being called where.


Turning off line numbers seemed to do the trick. That sucks though, because I really like having line numbers.


Here’s the profiler after turning off line numbers.


It’s still very strange to me that scrolling down still costs more cpu cycles than scrolling up though. I expect it should be equal.


Now here’s what it looks like in gnu emacs with a pretty bare init file.

(setq scroll-step 1
      scroll-margin 1
      scroll-conservatively 100000)
I’m still baffled as to why scrolling up and down is asymmetric.


I’m also baffled by just how slow adding line numbers is. Especially visual line numbers. That really makes me sad. I liked to have line numbers on so much, but I just can’t deal with the performance hit.


I’m not sure. Let me try it.


It’s still asymmetric even without advancing the screen.


I just set my line-numbers-width to 3 and it’s still slow as hell. Using emacs 27.2, but this problem also exists on emacs-28 and higher as well.


There are tons of tiny things; separately, each may look rather insignificant. When they are pulled in all at once, it becomes a problem. See, for example: hl-line - it works fine in Linux, on a Mac it slows down things, just enough to see the difference. which-key sometimes adds almost 30% overhead - especially if used in posframe mode. CIDER adds more things that increase latency. if you use lsp-mode - that too. I recently switched to Doom (after several years of Spacemacs) because I felt tired hunting down every single hook, advice, and feature that doesn't add significant utilitarian value for me. Spacemacs does a lot. Doom has its own problems, and switching to it wasn't completely smooth and painless for me. I wouldn't recommend switching to Doom if you already invested in Spacemacs. If you want performance - hunt down every single thing you don't need. Try disabling minor modes. Remove hooks, de-advice functions.


> I liked to have line numbers on so much don't use linum-mode, use built-in (since v27) display-line-numbers-mode instead. linum is too slow


I never use linum-mode, spacemacs uses display-line-numbers-mode by default, no?


@c.westrom Scrolling a buffer is not a very efficient with Emacs in general. Page up/down should be faster as is jumping to different locations in the buffer. There are many ways to configure smoother scrolling for Emacs - However, its still more efficient to learn how to navigate code rather than scrolling