From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53406 Path: main.gmane.org!not-for-mail From: Nevin Kapur Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Re: Slow IMAP startup Date: Sat, 12 Jul 2003 17:56:40 -0400 Organization: Mathematical Sciences, The Johns Hopkins University Sender: ding-owner@lists.math.uh.edu Message-ID: References: <84adbjzeki.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1058046999 15066 80.91.224.249 (12 Jul 2003 21:56:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 12 Jul 2003 21:56:39 +0000 (UTC) Original-X-From: ding-owner+M1950@lists.math.uh.edu Sat Jul 12 23:56:38 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19bSM9-0003ur-00 for ; Sat, 12 Jul 2003 23:56:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19bSMP-0007Z2-00; Sat, 12 Jul 2003 16:56:53 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19bSMH-0007Yu-00 for ding@lists.math.uh.edu; Sat, 12 Jul 2003 16:56:45 -0500 Original-Received: (qmail 44229 invoked by alias); 12 Jul 2003 21:56:44 -0000 Original-Received: (qmail 44224 invoked from network); 12 Jul 2003 21:56:44 -0000 Original-Received: from main.gmane.org (80.91.224.249) by sclp3.sclp.com with SMTP; 12 Jul 2003 21:56:44 -0000 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19bSLO-0003sn-00 for ; Sat, 12 Jul 2003 23:55:50 +0200 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19bSLM-0003sW-00 for ; Sat, 12 Jul 2003 23:55:48 +0200 Original-Lines: 43 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (darwin) Cancel-Lock: sha1:1M5S1aw76+n+3pX+KnkQMZUhFjg= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53406 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53406 kai.grossjohann@gmx.net (Kai Großjohann) writes: > Nevin Kapur writes: > >> I've noticed that Gnus takes an inordinately long time to start up. >> In the minibuffer I see the message "Listing subscribed groups on..." >> and I have to wait for about 3 to 4 minutes. > > See variable nnimap-request-list-method. Does it help? Not in any meaningful way. (But read on for the full story.) I set about trying to identify the bottleneck. Using elp and edebug, I think I identified a bug in nnimap-request-newgroups. While looping over nnimap-list-pattern it ignores the pattern, resulting in each of your subscribed mailboxes being accessed once for each pattern. The following patch fixes this and has cut the startup time for me by about a fourth. Would someone review it and commit it, please? 2003-07-12 Nevin Kapur * nnimap.el (nnimap-request-newgroups): Use the pattern in nnimap-list-pattern instead of "*". Index: lisp/nnimap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v retrieving revision 6.68 diff -u -r6.68 nnimap.el --- lisp/nnimap.el 17 Jun 2003 22:32:02 -0000 6.68 +++ lisp/nnimap.el 12 Jul 2003 22:04:14 -0000 @@ -1326,7 +1326,7 @@ (nnimap-before-find-minmax-bugworkaround) (dolist (pattern (nnimap-pattern-to-list-arguments nnimap-list-pattern)) - (dolist (mbx (imap-mailbox-lsub "*" (car pattern) nil + (dolist (mbx (imap-mailbox-lsub (cdr pattern) (car pattern) nil nnimap-server-buffer)) (or (catch 'found (dolist (mailbox (imap-mailbox-get 'list-flags mbx -Nevin