emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: desktop.el: autosave?


From: Stefan Monnier
Subject: Re: desktop.el: autosave?
Date: Thu, 06 Dec 2007 21:47:02 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> Saving a buffer's file is fast operation comparing to saving the desktop
> that takes more time because it is a cpu-intensive task that collects
> information from all buffers and some possibly long lists and writes
> to the usually large desktop file.  The default timeout for auto-save
> is 30 sec which is ok for auto-saving normal files, but I don't see a
> need to waste resources to save the desktop so often.

I have a hard time believing that it's so "CPU intensive".
Collecting info about 100 buffers is a no brainer that should be done in
a tiny fraction of a second even on a 10 year old CPU.  As for "large
desktop file", how large are we talking about? anything smaller than
100KB is not large nowadays.

> I have no serious problems with short intervals, but some users may have
> for various reasons (low memory that causes reading from the swap space
> when collecting data to save to the desktop file, slow disk access, etc.).

When swapping, you might be better off using a short idle interval so as
to reduce the risk of the pages having been swapped out while "idling"
(i.e. while some other process ran).

> So users may want to increase the timeout for the idle timer.  But the main
> problem with idle timers is that with long intervals they may never run.

Worse yet: long interval means it will be run right when the machine is
idle, i.e. when the disk was spun down.  Better run it when the machine
is still "active" so there's a better chance that the drive is
already spinning.

On top of that, writing to a file does not necessarily imply spinning up
the disk, because the actual write might be delayed by the OS to save power.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]