I am forced to use Windows 10 for a project. Yes, I would rather use GNU/Linux. To keep my sanity, I've tried to regard Windows as a bootloader for Emacs :)
Unfortunately, Magit (one of my favorite parts of Emacs, which also makes up for the lack of a good command line on Windows) is unbearably slow. I have an SSD, 16 GB of RAM and a quad-core i7 but it takes eight seconds to execute magit-status
on a small repository. Then, when I want to stage another change, it takes about 5 seconds per file.
Here's what I've tried:
$ git config --global core.preloadindex true
$ git config --global core.fscache true
$ git config --global gc.auto 256
- Adding the entire project to the Windows Defender (my only AV) exclusion list
- Setting the
magit-git-executable
to the regular msysgit one I downloaded (https://git-for-windows.github.io/). I checked andgit status
here takes < 1 second. I know thatmagit-status
does way more, but this is too much.
Can anyone suggest ways to make this faster? I can't imagine anyone using Magit on Windows like this.
It was suggested that this question is a duplicate, but they asked:
I'm struggling to understand why Emacs have noticeably shorter startup time on Ubuntu than Windows. Anyone knows the answer?
I know at least some reasons why Emacs, Git, and Magit are slower on Windows. I am asking how do I optimize Magit to do fewer things, or cache results, or something, even if it's at the expense of functionality.
git-status
takes <1 second? It should be essentially instantaneous. Is there any perceptible delay at all?git
commands from the command line?magit-git-executable
will probably be a bit faster (the ones incmd
andbin
are actually wrappers, ifexecutable-find
returns one of them magit will attempt to setmagit-git-executable
to the "real" git). 8 seconds for a small repository sounds like something else is wrong though, takes ~0.8s for magit's repo here (Windows 8).magit-refresh-verbose
tot
.