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

Re: Slow opening of IMAP mailboxes [mini-PATCH]



On Fri, Jan 09, 2004 at 05:27:22PM -0800, Chris Cutler wrote:
> ago, there was thread regarding mutt's performance when opening large
> IMAP mailboxes:

Here's a tiny patch that slightly improves the speed at which mutt opens a
large IMAP folder (please commit this!).

--- imap/command.c   Tue Sep 30 20:42:51 2003
+++ imap/command.c.new       Tue Sep 30 20:43:04 2003
@@ -461,6 +461,7 @@

   msgno = atoi (s);

+       if (msgno < idata->ctx->msgcount)
   /* see cmd_parse_expunge */
   for (cur = 0; cur < idata->ctx->msgcount; cur++)
   {

> The thread discussed pros and cons and implementation details but then
> petered away and I haven't found much discussion of the issue since.
> I've seen the headercache patch (http://dwyn.net/mutt/) which seems like
> a useful solution but doesn't take the approach I'm interested in.  
> I'm interested in a solution which speeds up even the initial opening of the
> mailbox by asking the server to do sorting (preliminarily, at least) and
> then requesting only enough messages to fill the user's visible index.

I've been working on this approach for almost a year now, but not too
seriously - it's not as simple as one would like.  I currently have a
patch which downloads only the headers needed to sort the mailbox, then
downloads additional headers as necessary to display them.  This works well;
the delay when scrolling through a mailbox is minimal.  However, there are
significant problems left to solve, related to hooks and limit patterns.
I would be happy to send you what I have (you might even find it by looking
back in the archives) but be warned that it will cause your mutt to crash.

Nathan