all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: autosave in the background
Date: Tue, 11 Jul 2017 11:58:44 +0200	[thread overview]
Message-ID: <20170711095844.GA17698@tuxteam.de> (raw)
In-Reply-To: <877ezf5n5o.fsf@skimble.plus.com>

-----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-----



  reply	other threads:[~2017-07-11  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-11  9:38 autosave in the background Sharon Kimble
2017-07-11  9:58 ` tomas [this message]
2017-07-11 17:46 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170711095844.GA17698@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.