darcs

Issue 1092 cache discoverability

Title cache discoverability
Priority feature Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, twb, zooko
Assigned To twb
Topics Performance, UI

Created on 2008-09-23.02:39:28 by twb, last changed 2009-08-27.14:29:48 by admin.

Messages
msg6089 (view) Author: twb Date: 2008-09-23.02:39:26
Darcs 2 introduced cache support, so that doing something like "darcs
get http://darcs.net/" repeatedly will be fast:

    http://wiki.darcs.net/DarcsWiki/DarcsTwo#head-0067d46570f52895692323380bf1e4ea5a8bd1da

I'm concerned that normal users -- that is, ones that don't read
release notices or track the darcs mailing list -- are currently
unlikely to discover that this feature exists, and thus get no benefit
from it.

I'm not sure how to go about addressing this.  Currently darcs will
ask for a user name if it needs one and can't find ~/.darcs/author or
_darcs/author.  I guess I'd like something along those lines.

Note that the purpose of this issue isn't to automatically create and
maintain a completely correct ~/.darcs/sources file, but to 1) make
the user aware that the cache feature exists; and 2) give them a basic
setup which will mostly work.

Here's a mockup:

    $ cd /home/twb/Desktop
    $ darcs get http://darcs.net/ darcs

    There are no cache directories configured.  Adding a cache
    directory will make some operations much faster, and can avoid
    unnecessary network traffic.

This interaction would tripped whenever a cache-using command is used,
and there is no ~/.darcs/sources file.  If the user picks "go away, I
want no cache", it would create an empty ~/.darcs/sources, thereby
preventing the question being asked next time.

    Create a darcs cache ~/.darcs/cache? [Y/n]

This just makes the empty directory and adds it to ~/.darcs/sources in
read-write mode.

    Add other users' darcs caches in read-only mode? [Y/n]

This would make a best effort, maybe looking for ~/.darcs/cache for
all users, or entries in ~/.darcs/sources for all users.  It would
obviously ignore any entries that didn't exist or weren't readable.

    To get the full advantages of caching, create a cache on each
    filesystem on which you have darcs repositories.

This part needs rewriting but basically we want users to know that to
leverage hard links, if they're keeping repos in /var/darcs and /var
and /home are seprate filesystems, they need another cache on /var
somewhere.
msg6094 (view) Author: zooko Date: 2008-09-23.12:20:10
I like the idea!  I, too, have been noticing that some of the users that I
support are not using caches even though they wish darcs were faster.  But, as
David originally pointed out, it could be problematic to start using an
unboundedly growing amount of their disk space without mentioning it.

So I really like this suggestion.  The interactive text should mention that it
is always safe to /bin/rm -rf your cache directory (since that is the only way
that the cache directory can shrink in size).
msg6095 (view) Author: twb Date: 2008-09-23.14:30:04
On Tue, Sep 23, 2008 at 12:20:13PM -0000, Zooko wrote:
> 
> Zooko <zooko@zooko.com> added the comment:
> 
> I like the idea!  I, too, have been noticing that some of the users that I
> support are not using caches even though they wish darcs were faster.  But, as
> David originally pointed out, it could be problematic to start using an
> unboundedly growing amount of their disk space without mentioning it.
> 
> So I really like this suggestion.  The interactive text should mention that it
> is always safe to /bin/rm -rf your cache directory (since that is the only way
> that the cache directory can shrink in size).

Regarding best practices, I run this in an an @weekly cron job:

    find ~/.cache/ -type f -atime +31 -print -delete

(I use .cache/darcs rather than .darcs/cache, because it makes xdu
more obvious.)
msg8320 (view) Author: kowey Date: 2009-08-21.17:36:53
Can we wont-fix or resolve this now that the global cache (issue839) is on by
default, or do we need to do other work here?
msg8364 (view) Author: twb Date: 2009-08-23.00:23:44
Resolved long ago; a cache is created automatically in 2.2 and higher.
History
Date User Action Args
2008-09-23 02:39:28twbcreate
2008-09-23 12:20:13zookosetpriority: feature
nosy: + zooko
status: unread -> unknown
messages: + msg6094
2008-09-23 14:30:06twbsetnosy: kowey, zooko, dagit, simon, twb
messages: + msg6095
2009-08-10 23:46:10adminsetnosy: + dmitry.kurochkin, thorkilnaur, - dagit
2009-08-21 17:37:00koweysetstatus: unknown -> waiting-for
nosy: kowey, zooko, simon, twb, thorkilnaur, dmitry.kurochkin
topic: + Performance, UI
messages: + msg8320
assignedto: twb
2009-08-23 00:23:46twbsetstatus: waiting-for -> resolved
nosy: kowey, zooko, simon, twb, thorkilnaur, dmitry.kurochkin
messages: + msg8364
2009-08-25 17:25:16adminsetnosy: + darcs-devel, - simon
2009-08-27 14:29:48adminsetnosy: kowey, darcs-devel, zooko, twb, thorkilnaur, dmitry.kurochkin