[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: autosave in the background
From: |
tomas |
Subject: |
Re: autosave in the background |
Date: |
Tue, 11 Jul 2017 11:58:44 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----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-----