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

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



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.

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

> Every message you rename means you open the directory again.

readdir(3), too? why? isn't rename(2) enough?

> For mail folders with very large numbers of messages on anything
> resembling traditional Unix filesystems, mbox will win. Guaranteed.

on my system (FreeBSD 6.0-p1), renaming 1000 files took less than a
second...

-- 
Stanisław Halik, http://tehran.lain.pl

Attachment: pgpGRrL3qf6Xq.pgp
Description: PGP signature