<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] hcache reorganization



On Thursday, 29 November 2007 at 12:43, Rocco Rutte wrote:
> Hi,
>
> since people on mutt-users@ reported that hcache db files always kept  
> growing, I looked into it. I can confirm this here for qdbm.
>
> My guess is that the db libraries don't do the costly optimization of  
> really removing dead entries but mark them as dead only. With the  
> attached patch, my cache file sizes went down immedtiately.
>
> However, reorganization is a) only supported by qbdm and gdbm as it  
> seems, and b) may take quite some time (up to 1.2 seconds for a 300k  
> folder with a ~74 MB qdbm-compressed hcache db).
>
> I think once mutt provides caching features and asks the user leave them  
> mostly alone, mutt shouldn't let them grow forever. Hence the attached  
> patch only tries to use the reorg facilities only upon syncing the  
> mailbox every 20th time. The counter is stored within the cache file  
> itself.
>
> Right now this is hardcoded, but I think we might want to increase 20  
> since the disk space gains are measurable but quite low. I don't think  
> this should be user-configurable. A compile-time option might do it, too.
>
> Comments and opinions?

I agree that 20 is too low. I'd like to see this unified with
$message_cache_clean ($cache_clean perhaps?) and default to off. The
disadvantage of that setting is that you have to visit each folder you
want cleaned up while the setting is active. But the advantage is that
you don't pay the price for the garbage collection for any folder
where you aren't bothered by its space usage.

I suppose another possibility is to trigger it when a certain ratio of
dead entries is reached.

Attachment: pgpXWsciR9kOU.pgp
Description: PGP signature