spacemacs

West 2021-11-21T02:40:12.100900Z

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?

West 2021-11-21T02:41:25.101300Z

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

West 2021-11-21T03:04:13.104Z

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

West 2021-11-21T03:04:47.104200Z

Here’s the profiler after turning off line numbers.

West 2021-11-21T03:10:01.104600Z

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.

West 2021-11-21T03:29:09.105Z

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.

West 2021-11-21T03:37:35.105400Z

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.

West 2021-11-21T04:16:21.107900Z

I’m not sure. Let me try it.

West 2021-11-21T04:18:26.108100Z

It’s still asymmetric even without advancing the screen.

West 2021-11-21T04:56:40.110800Z

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.

ag 2021-11-22T22:09:46.117500Z

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.

ag 2021-11-22T22:16:50.117900Z

> 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

West 2021-11-22T23:04:39.118100Z

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

practicalli-johnny 2021-11-21T13:09:03.114600Z

@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 - https://www.emacswiki.org/emacs/SmoothScrolling However, its still more efficient to learn how to navigate code rather than scrolling https://practical.li/spacemacs/navigating-code/