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

Re: Mark messages in mailbox as read without massive performance hit?!



On Thu, Dec 29, 2005 at 05:53:53AM +0100, Stanislaw Halik wrote:
> Derek Martin <invalid@xxxxxxxxxxxxxx> wrote:
> >> doing it in a mbox requires rewriting the whole mbox from the Status:
> >> line of the first message you're changing.  It's a lot *CHEAPER* in a
> >> maildir than in a mbox, unless your filesystem is totally nuts.  
> > To do it ONCE is cheaper in maildir.  To do it a whole bunch of times
> > ends up being extremely expensive, because the overhead to open a file
> > is very high.

I should note that I don't keep large attachments in my mail folders,
so this is exaggerated for my personal mail usage.  I end up with lots
of small messages which weighs heavily in favor of mbox.  I'll adjust
my statements accordingly.

> rename() doesn't involve opening any files, it just takes two (char *)
> parameters with filesystem paths.

How do you suppose the file name changes?

The kernel opens the directory (which, on most Unix filesystems, is
just a file, albeit a special one) and changes the name associated
with that directory entry.  Then it closes the file.  Generally, each
rename operation will result in the kernel doing this separately.
There's no facility to queue these operations to optimize them.

So, my amended statement: Depending on your hardware, and the
filesystem, and your mail usage, and a whole lot of other factors, if
you have lots of e-mail messages, mbox will win over maildir for large
numbers of messages.  

Obviously, the user who posted this message is running into this
problem, or else we would not be having this discussion...

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail.  Sorry for the inconvenience.  Thank the spammers.

Attachment: pgpDlyra0UXQ4.pgp
Description: PGP signature