Fork me on GitHub
#spacemacs
<
2022-02-11
>
Drew Verlee16:02:49

What are some common ways to keep spacemacs as snappy and fast as possible? I realize this is something of an impossible question, but maybe there are some easy wins. Like if it was the jvm maybe you would check how much mem was allocated. Or how in most projects having as few deps as possible usually helps.

practicalli-johnny16:02:42

Profile Emacs to see if there is any issues seems to be a common approach https://practical.li/spacemacs/install-spacemacs/troubleshooting.html#profiling-emacs

practicalli-johnny16:02:53

The scorched earth approach would be to backup your config and reinstall from scratch. Test without applying any of your own configuration and steadily add your customisations back in to see if there is an impact

practicalli-johnny16:02:17

Less drastic would be to remove any config and packages not needed. Also clean out the .cache files

practicalli-johnny16:02:33

Removing unused layers shouldn't make any difference, as its all lazy loaded. It could be possible that a package in a layer is causing problems. This package could be excluded by adding the package name to dotspacemacs-excluded-packages although this might break some functionality.

practicalli-johnny16:02:46

I added some font rendering optomisations to dotspacemacs/user-config but not sure if they made any real difference. https://github.com/practicalli/spacemacs.d/blob/live/init.el#L806-L825

practicalli-johnny16:02:30

If using MacOSX, then some versions of Emacs are not that fast when running Spacemacs. These seem to be the recommended versions https://github.com/syl20bnr/spacemacs/tree/develop#macos

practicalli-johnny16:02:16

A potentially significant change is to switch to Ivy for completion, rather than helm. I believe this is done by adding the ivy layer and removing the helm layer in the Spacemacs configuration layers. https://develop.spacemacs.org/layers/+completion/ivy/README.html Ivy is a sub-set of the features of helm, so you may or may not miss those features.

practicalli-johnny17:02:50

Oh, and of course, update Spacemacs code, your Spacemacs config against the template (`SPC f e D`) and get the latest packages (`SPC f e U`) to get the latest updates and improvements (but dont update when you are busy in the rare case that there is an issue) https://practical.li/spacemacs/install-spacemacs/update.html

practicalli-johnny17:02:29

Finally, use Emacs 28 with native compilation. This may speed things up or break things (or both)

👀 2
Diego Naya19:02:39

I had a great speedup migrating from emacs27 (the std package in fedora 35) to emacs 28 (had to install an outside package)

Drew Verlee22:02:45

Thanks a ton! I'm definitely going to try these ideas over the weekend.

Drew Verlee22:02:16

Moving around my project has been sluggish and that's a mental drag i don't need.

Drew Verlee03:02:23

ok wow. yea. i'm on 28 right now and it feels snapper. That or i'm just excited its Friday. time will tell i suppose.

🎉 1
practicalli-johnny11:02:32

I am curious to understand what is sluggish when moving around projects. What commands are used?

practicalli-johnny11:02:12

Nothing like a new installation to give a sense of speed 😁 All those newly downloaded and complied Emacs pages should help, even more so if the packages were natively compiled (something I haven't tried yet)

Drew Verlee13:02:36

Just normal text movement (evil mode up down etc..) had delays i was noticing. I didn't run profiler and collect samples so I'm not sure how often it was happening or why. But 28 feels faster right out of the box for me. I used the snap from ubuntu which i read is natively compiled.