Previous: , Up: Performance   [Contents][Index]


MacOS Performance

On macOS Emacs currently creates child processes using fork. It appears that this also copies GUI resources. The result is that forking takes about 30 times as long on Darwin than on Linux. And because Magit starts many git processes even when doing simple things, that makes quite a difference.

On the master branch Emacs now uses vfork when possible, like this was already done on Linux, and now child creation only takes about twice as long on Darwin. See 2 for more information.

Nobody knows when the changes on the master branch will be released as 26.1, but it is still a long way off. You might want to get your hands on this change before then. The easiest way to get a patched Emacs is to install the emacs-plus formula 3 using homebrew. The change has been backported, so you get it not only when using --HEAD, but also when using --devel or when installing the latest release (by not using a version argument).

Alternatively you can apply the backport 4 manually.


Footnotes

(2)

https://lists.gnu.org/archive/html/bug-gnu-emacs/2017-04/msg00201.html

(3)

https://github.com/d12frosted/homebrew-emacs-plus

(4)

https://gist.githubusercontent.com/aaronjensen/f45894ddf431ecbff78b1bcf533d3e6b/raw/6a5cd7f57341aba673234348d8b0d2e776f86719/Emacs-25-OS-X-use-vfork.patch