Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <simon@josefsson.org>
To: James Cloos <cloos+math_uh-ding@jhcloos.com>
Cc: ding@gnus.org
Subject: Re: gnus-group-find-new-groups vs nnimap
Date: Wed, 29 Aug 2007 15:17:34 +0200	[thread overview]
Message-ID: <87ir6ypjip.fsf@mocca.josefsson.org> (raw)
In-Reply-To: <m3hcmofcfz.fsf@lugabout.jhcloos.org> (James Cloos's message of "Sat, 25 Aug 2007 00:46:33 -0400")

James Cloos <cloos+math_uh-ding@jhcloos.com> writes:

> One issue I've seen with nnimap is that, when it is asked for new
> groups (either at gnus startup or due to an explicit call to
> gnus-group-find-new-groups) it EXAMINEs *every* group returned by
> the call to LSUB, rather than just the new groups.  That means that
> at startup EXAMINE is called on every known group *twice*.
>
> The time loss for doing that is significant for me.  On the order
> of hours.
>
> The code looks like:
>
> ,----( from gnus/lisp/nnimap.el )
> | (deffoo nnimap-request-newgroups (date &optional server)
> |   (when (nnimap-possibly-change-server server)
> |     (with-current-buffer nntp-server-buffer
> |       (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s..."
> |                     (if (> (length server) 0) " on " "") server)
> |       (erase-buffer)
> |       (nnimap-before-find-minmax-bugworkaround)
> |       (dolist (pattern (nnimap-pattern-to-list-arguments
> |                         nnimap-list-pattern))
> |         (dolist (mbx (imap-mailbox-lsub (cdr pattern) (car pattern) nil
> |                                         nnimap-server-buffer))
> |           (or (catch 'found
> |                 (dolist (mailbox (imap-mailbox-get 'list-flags mbx
> |                                                    nnimap-server-buffer))
> |                   (if (string= (downcase mailbox) "\\noselect")
> |                       (throw 'found t)))
> |                 nil)
> |               (let ((info (nnimap-find-minmax-uid mbx 'examine)))
> |                 (when info
> |                   (insert (format "\"%s\" %d %d y\n"
> |                                   mbx (or (nth 2 info) 0)
> |                                   (max 1 (or (nth 1 info) 1)))))))))
> |       (gnus-message 5 "nnimap: Listing subscribed mailboxes%s%s...done"
> |                     (if (> (length server) 0) " on " "") server))
> |     t))
> `----
>
> As far as I can tell, at the point just before (nnimap-find-minmax-uid
> mbx 'examine) is called, I'd need to search for (mbx) in the current
> buffer and skip the (insert) if it is found, yes?

Does the buffer really contains the same group information twice at that
point?  Note that the function calls (erase-buffer).  So I suspect you
won't find the information that nnimap-find-min-maxuid generates in the
buffer.  You could cache that information in some variable, but then you
run into stale-cache issues.

/Simon




  reply	other threads:[~2007-08-29 13:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-25  4:46 James Cloos
2007-08-29 13:17 ` Simon Josefsson [this message]
2007-08-29 20:52   ` James Cloos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ir6ypjip.fsf@mocca.josefsson.org \
    --to=simon@josefsson.org \
    --cc=cloos+math_uh-ding@jhcloos.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).