On Wed, Jul 15, 2015 at 09:34:25AM +1000, m...@raf.org wrote:
> Derek Martin wrote:
> 
> > On Tue, Jul 14, 2015 at 08:23:25PM +0200, Heinz Diehl wrote:
> > > On 14.07.2015, Kevin J. McCarthy wrote: 
> > > > With mbox, I guess the designers thought there wouldn't be that much of 
> > > > a speed improvement
> > > > because it's just a sequential read of a single file.
> > > 
> > > That sounds reasonable.
> > 
> > Except, as far as I can tell, it isn't.  I see no reason hcache could
> > not significantly speed up scanning mbox folders as well, at least on
> > any system that supports lseek() or similar (which I imagine is any
> > system that Mutt runs on currently).  The amount of benefit you'd get
> > from this would greatly depend on the nature of the messages stored in
> > the folder, though...  Folders of moderate size or larger, with mostly
> > large messages (or attachments) should see the most benefit, and those
> > with many small messages, or with very few messages, would see the
> > least (but still some).
> 
> for lseek() to be useful, you need to know where to lseek to
> which you wouldn't in this case (if you want reliable parsing).

That's easy though, obviously you need to fully parse unread messages,
but once they're parsed, you just cache the offsets.  You might need
to reparse of the thing at the offset you've cached doesn't look like
a message (doesn't start with "From  ") but otherwise you should be
good.

> and anyway, i'd like to think mutt uses mmap() for mbox files.

I'd like to think that too, but it doesn't. ;-)  Or at least, my
recollection is that it doesn't.  I brought this up in the (distant)
past, and IIRC the response was that too many systems had a broken
mmap and that it could be underperforming file I/O for other reasons.
Which sounded like a crock to me, but I let it go at that, since I
didn't want to rewrite the mbox code.


-- 
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 due to spam prevention.  Sorry for the inconvenience.

Attachment: pgpdkyyMe15L3.pgp
Description: PGP signature

Reply via email to