From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: autosave in the background Date: Tue, 11 Jul 2017 11:58:44 +0200 Message-ID: <20170711095844.GA17698@tuxteam.de> References: <877ezf5n5o.fsf@skimble.plus.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1499767241 7070 195.159.176.226 (11 Jul 2017 10:00:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Jul 2017 10:00:41 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 11 12:00:37 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUry9-0001dw-8O for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jul 2017 12:00:37 +0200 Original-Received: from localhost ([::1]:45244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUryE-00023u-DQ for geh-help-gnu-emacs@m.gmane.org; Tue, 11 Jul 2017 06:00:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUrxZ-000227-S0 for help-gnu-emacs@gnu.org; Tue, 11 Jul 2017 06:00:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUrxV-00026E-1i for help-gnu-emacs@gnu.org; Tue, 11 Jul 2017 06:00:01 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:34257 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUrxU-00022e-R1 for help-gnu-emacs@gnu.org; Tue, 11 Jul 2017 05:59:56 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1dUrwK-0004j3-Su for help-gnu-emacs@gnu.org; Tue, 11 Jul 2017 11:58:44 +0200 In-Reply-To: <877ezf5n5o.fsf@skimble.plus.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113752 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, Jul 11, 2017 at 10:38:11AM +0100, Sharon Kimble wrote: > > Is it possible for emacs to autosave in the background? > > I have a file that I'm working on which is 3.3mbs in size, using > org-mode, and whilst I'm writing it *everything*, literally everything, > stops and pauses, becoming unresponsive until its saved completely. > Hence my request. It would make sense first to understand what's going on. Most probably it isn't "disc" write times. Consider my box, a "netbook" class machine with a (slow) mechanical disk (and full disk encryption, which means that disk I/O sends one of both CPUs out fot lunch): | tomas@rasputin:~$ time dd if=/dev/zero of=/tmp/foo bs=4096 count=1024 | 1024+0 records in | 1024+0 records out | 4194304 bytes (4.2 MB) copied, 0.0192296 s, 218 MB/s | | real 0m0.024s | user 0m0.004s | sys 0m0.016s That's 4M, so in your case's ballpark. OK, OK, I cheated: of course the sync to disk is happening in the background and doesn't count towards the 24 ms above. Now with sync: | tomas@rasputin:~$ time dd if=/dev/zero of=/tmp/foo bs=4096 count=1024 conv=fdatasync | 1024+0 records in | 1024+0 records out | 4194304 bytes (4.2 MB) copied, 0.14341 s, 29.2 MB/s | | real 0m0.151s | user 0m0.008s | sys 0m0.016s Still "just" 150 ms (and I expect your case to be more the "cheating" case: I don't think Emacs waits for a sync before coming back). So there must be something else going on. Perhaps you can profile a "save file"? Cheers - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAllkoVQACgkQBcgs9XrR2kbjmgCdGAU2oRaByN+2oAliK3bfuWGy 9A8AnjRaZz4fqYM0nITIpOTFh+IXcnFV =8OOb -----END PGP SIGNATURE-----