Subject: bug#42911: 28.0.50; write_region sometimes extremely very slow

From: Eli Zaretskii <[email-masked]>
Date: Tue, 18 Aug 2020 13:44:56 +0300

> From: Tino Calancha <[email-masked]>
> Date: Tue, 18 Aug 2020 11:46:13 +0200
> Cc: [email-masked]
> 
> Recipe:
> emacs -Q ~/save-buffer-slow.txt
> ;; insert few characters and run
> M-: (benchmark-run nil (save-buffer))
> 
> ;; Repeat several times: sometimes it takes a reasonable time, but
> ;; in others it takes huge time
> ;; (6-10 s to save a buffer with less that 50 characters)
> 
> It happens randomly.

Did you check that GC doesn't kick in when the "slow" saving happens?