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

Re: mutt slow with Maildirs???



2003-09-11T13:56:50 shantanu:
> Just out of curiouslity how much time did it take and did anyone else
> have this problem. I use mbox format many times. I find it comfortable
> but was going to try maildir. But it the time taken is large i wont'

The only really safe answer is, try it and see. Pick a few of your
bigger folders, open 'em up in mutt, tag ~A, then ;s to a maildir.
"x" to exit without saving, or T~A and ;u to undelete them, then
turn mutt to the maildir and see whether it hurts.

There is not one answer.

Here are some factors:

- On some filesystems (most older ones), all operations related to
  directories, including opening every file in the directory to read
  it, get slow quadratically in directory size (O(N^2)), rather than
  the O(NlogN) you expect from well-chosen data structures.

- Opening a file, reading from it, and closing it is more expensive
  than doing a few short reads, regardless.

The first point means that if you aren't using ext3+hashdirs,
Reiserfs, WAFL, XFS, or whatever other modern filesystems have good
large-dir performance, Maildir folders with many thousands of
messages will get slow, regardless.

The second point means that if you have many thousands of messages
in a folder, and they aren't particularly large messages, mbox will
be way faster to open the folder, no matter what.

But the flip side of that latter point is that if you have many
_huge_ messages, let's say 1MB or bigger (that's a guess, the
breakeven point might be bigger or smaller than that by an order of
magnitude for all I know, and will certainly vary from platform to
platform) Maildir can get faster than mbox to open.

Other operations have different performance tradeoffs. Deleting the
first message in a Maildir is quick and cheap; deleting the first
message in a gigantic mbox requires copying the entire thing, which
is neither quick nor cheap. It can be done in place, but will still
take a lot of time, and if done in-place a crash during the long
slow operation will leave the mbox corrupt.

Adding messages to, removing messages from, and changing the status
of messages in a folder are operations that are simple, safe,
atomic, and quick with Maildir; they scale with mbox size and the
position of the message in the mbox for mbox format folders.

Maildir folders are easily manipulated with normal shell tools, mbox
folders need parsers and clever logic to do message-by-message
manipulations on them.

-Bennett

Attachment: pgpKMQPnDzysW.pgp
Description: PGP signature