mail/mutt-devel: regression in 1.5.12

Vasil Dimov vd at FreeBSD.org
Fri Sep 15 08:09:16 PDT 2006


On Wed, Aug 09, 2006 at 01:49:53PM +0300, Vasil Dimov wrote:
>
> Since I upgraded mutt-devel from 1.5.11 to 1.5.12 moving through the
> messages became hell slow.
>
> I use IMAP and when I open a folder and hold down ``j'' or down-arrow
> the hilighted line starts to move downside very slow (just as if the
> keyboard repeat rate is set up low). When it reaches 5th message I
> release the ``j'' key and it goes by itself up to the 18th message.
> I find this really annoying and it renders mutt almost unusable for me :/
> I just installed 1.5.11 again and the hilighted line flies like an arrow
> and stops as soon as I release ``j'', so the problem is definedly
> between 1.5.11 and 1.5.12.

[...]

> 
> I think I got close to the problem.
> 
> It is not exactly if the protocol is imap:// or imaps://
> but rather how many mailboxes with the same prefix
> (imap://vd:__secret__@pop/) I have. E.g. the more folders I have the
> worst it gets.
> 
> Firstly some more deatils on my setup:
> 
> I have 14 folders listed in my muttrc:
> mailboxes imaps://vd:__secret__@pop/
> mailboxes imaps://vd:__secret__@pop/freebsd-ports
> mailboxes imaps://vd:__secret__@pop/freebsd-hackers
> mailboxes imaps://vd:__secret__@pop/freebsd-amd64
> mailboxes imaps://vd:__secret__@pop/freebsd-ports-bugs
> mailboxes imaps://vd:__secret__@pop/spam
> ...
> 
> In my testing I changed just one of them to
> mailboxes imap://vd:__secret__@pop/freebsd-ports-bugs
> and then moving through the messages in there was fine.
> When I changed all of them to imap:// the problem reappeared.
> 
> Next I disabled SSL support on the server (so TLS is not negotiated
> via the plaintext imap://) and tested with all 14 folders set to imap://
> The result was that the problem existed but things were just a little
> bit better.
> 
[...]

Today I did some digging and came out with a patch:

--- patch-curs_main.c__speed.diff begins here ---
--- curs_main.c.orig	Thu Jun  8 14:50:29 2006
+++ curs_main.c	Fri Sep 15 17:45:18 2006
@@ -523,7 +523,18 @@
     imap_disallow_reopen (Context);
 #endif
 
-    if (!attach_msg)
+    if (!attach_msg
+#ifdef USE_IMAP
+	/* In some circumstances (SSL with 10+ IMAP mailboxes) checking
+	 * for new mail (more precisely - imap_buffy_check()) on every
+	 * keystroke is *very* slow, so skip this check for the two most
+	 * common move-up and move-down keystrokes.
+	 * Read this whole thread:
+	 * http://lists.FreeBSD.org/pipermail/freebsd-ports/2006-August/034559.html
+	 */
+	&& op != OP_MAIN_NEXT_UNDELETED && op != OP_MAIN_PREV_UNDELETED
+#endif
+       )
     {
      /* check for new mail in the incoming folders */
      oldcount = newcount;
--- patch-curs_main.c__speed.diff ends here ---

This is generally "do not call the slow function whem moving through the
messages with j and k keys". Obviously this kills some functionality.

The thing I didn't figure out is "why 1.5.11 does not suffer from the
problem and works just fine?".

-- 
Vasil Dimov
gro.DSBeerF at dv

Testing can show the presence of bugs, but not their absence.
                -- Edsger W. Dijkstra


More information about the freebsd-ports mailing list