GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 on Windows 7. Somedays (yes, weirdly, it seems to be only some days), Emacs takes a very long time (a few seconds) when reading or writing to disk. This happens most notably when using
save-buffer. It happens in fundamental mode, and when i run
emacs -q, so I don't think it is related to my setup.
It doesn't seem to happen in other text-editors, but it might just be that other text-editors does save asynchronously, while emacs is famously single-threaded, and so would block everytime. I suspect that the issue might come from some of the spyware that my employer installs on our computers, but I'm at a loss on how to debug. What could the source of this error be?
I've tried the profiler to find the source of the slowness. Here is the output for one slow save:
- ... 5 83% Automatic GC 5 83% - command-execute 1 16% - call-interactively 1 16% - profiled-save-buffer 1 16% - let 1 16% - save-buffer 1 16% - basic-save-buffer 1 16% - basic-save-buffer-1 1 16% basic-save-buffer-2 1 16%
Of course, this is very weird. The actual save took 13.863000 seconds, the sampling interval is 1000000. If I understand the profiler correctly I should have more than 1000 samples, but here I only got one. Here is the code I use for profiling:
(defun profiled-save-buffer () "" (interactive) (profiler-start 'cpu) (measure-time (save-buffer) (profiler-report) (profiler-stop)) (select-window (previous-window)))