Fork me on GitHub
#emacs
<
2024-05-22
>
respatialized13:05:37

anyone else experience extremely slow file write performance on MacOS? I observe file write latency >1m when using emacs-plus with version 29.

respatialized13:05:31

probably going to dig into it with https://github.com/aspiers/etrace if I continue to observe this, will note findings here

Ben Sless14:05:00

Yes. It's sporadic but annoying when it happens

practicalli-johnny18:05:55

Emacs-plus works fine on Mac I was given for work (Arm chipset). I did not choose to use the native compilation, just normal Emacs config.

Linus Ericsson20:05:51

oh, this could be it.

1
respatialized12:05:46

update: profiling the function with etrace has revealed that... save-buffer is slow. no indication whatsoever of where the time is going, but I need to take some more time to see if I can get more detailed tracing.

respatialized12:07:30

update: I have observed this issue on a Linux VM as well. previous profiling efforts didn't reveal this, but after checking my hooks I have a strong reason to believe the vc-refresh-state function was a major contributing factor to this latency. Disabling the hook that called it, added automatically by the lambda-line package, made performance significantly better - on multiple systems. I am not the only person to https://stackoverflow.com/questions/6724471/git-slows-down-emacs-to-death-how-to-fix-this (this is, to be fair, from quite a while ago) with the built-in vc backend. Worth checking if you observe this issue as well! tl;dr - if you have bad performance with file writes, check your hooks and see if you can speed up or disable vc related commands.

👍 1
respatialized12:07:42

another potential optimization if you need vc-related hooks: the default value of vc-handled-backends is almost certainly looking for ancient VC systems you don't care about:

vc-handled-backends is a variable defined in 'vc-hooks.el'.

Its value is (RCS CVS SVN SCCS SRC Bzr Git Hg)
you can set it to git alone:
(setq vc-handled-backends '(Git))
and avoid that.

respatialized12:07:30

update: I have observed this issue on a Linux VM as well. previous profiling efforts didn't reveal this, but after checking my hooks I have a strong reason to believe the vc-refresh-state function was a major contributing factor to this latency. Disabling the hook that called it, added automatically by the lambda-line package, made performance significantly better - on multiple systems. I am not the only person to https://stackoverflow.com/questions/6724471/git-slows-down-emacs-to-death-how-to-fix-this (this is, to be fair, from quite a while ago) with the built-in vc backend. Worth checking if you observe this issue as well! tl;dr - if you have bad performance with file writes, check your hooks and see if you can speed up or disable vc related commands.

👍 1