Gnus development mailing list
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bmork@dod.no>
Subject: Re: IMAP article move
Date: Tue, 11 Jan 2005 10:16:46 +0100	[thread overview]
Message-ID: <87mzvgxr41.fsf@obelix.mork.no> (raw)
In-Reply-To: <ilusm7kujnw.fsf@latte.josefsson.org>

[-- Attachment #1: Type: text/plain, Size: 946 bytes --]

Simon Josefsson <jas@extundo.com> writes:

> What are you proposing?  There is some optimization in
> nnimap-request-move-article and nnimap-request-accept-article to make
> moving more efficient, and I thought it was pretty fast.  But I rarely
> copy/move articles, so I wouldn't know.  Maybe you could illustrate by
> comparing which IMAP commands are sent now, and which commands you
> want to be sent?

On a related issue: nnimap expiry with an expiry-target on the same
IMAP server is terribly slow.  To the degree that's entirely unusable.

I just got a new laptop and installed a fresh copy of CVS Gnus, and
that's when I noticed that this hasn't been fixed.  The attached patch
has fixed the problem for me on the old laptop (and now also on the
new one).

nnimap expiry will still be unecessarily slow with other expiry-
targets, but I don't know how to fix that.



Bjørn
-- 
How can you say that you wish you were a mental problem?  


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnimap-fix.patch --]
[-- Type: text/x-patch, Size: 1763 bytes --]

Index: lisp/nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 7.13
diff -u -u -r7.13 nnimap.el
--- lisp/nnimap.el	26 Oct 2004 17:40:05 -0000	7.13
+++ lisp/nnimap.el	11 Jan 2005 08:53:24 -0000
@@ -1452,14 +1452,23 @@
 
 (defun nnimap-expiry-target (arts group server)
   (unless (eq nnmail-expiry-target 'delete)
-    (with-temp-buffer
-      (dolist (art arts)
-	(nnimap-request-article art group server (current-buffer))
-	;; hints for optimization in `nnimap-request-accept-article'
-	(let ((nnimap-current-move-article art)
-	      (nnimap-current-move-group group)
-	      (nnimap-current-move-server server))
-	  (nnmail-expiry-target-group nnmail-expiry-target group))))
+    (if (and (not (functionp nnmail-expiry-target)) 
+	     (gnus-server-equal (gnus-group-method nnmail-expiry-target) 
+				(gnus-server-to-method 
+				 (format "nnimap:%s" server))))
+	;; moving article within same server, speed it up...
+	(and (nnimap-possibly-change-group group)
+	     (imap-message-copy (imap-range-to-message-set arts)
+				(gnus-group-short-name nnmail-expiry-target) 
+				'dontcreate nil nnimap-server-buffer))
+      (with-temp-buffer
+	(dolist (art arts)
+	  (nnimap-request-article art group server (current-buffer))
+	  ;; hints for optimization in `nnimap-request-accept-article'
+	  (let ((nnimap-current-move-article art)
+		(nnimap-current-move-group group)
+		(nnimap-current-move-server server))
+	    (nnmail-expiry-target-group nnmail-expiry-target group)))))
     ;; It is not clear if `nnmail-expiry-target' somehow cause the
     ;; current group to be changed or not, so we make sure here.
     (nnimap-possibly-change-group group server)))

      parent reply	other threads:[~2005-01-11  9:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-08 19:19 Ted Zlatanov
2004-11-08 20:50 ` Raymond Scholz
2004-11-08 21:15 ` Simon Josefsson
2004-11-09 22:00   ` Ted Zlatanov
2004-11-09 22:06     ` Simon Josefsson
2005-02-25 19:59       ` IMAP article move optimization! (was: IMAP article move) Ted Zlatanov
2005-02-28  0:00         ` IMAP article move optimization! Katsumi Yamaoka
2005-02-28 15:11           ` Ted Zlatanov
2005-03-01  0:37             ` Katsumi Yamaoka
2005-03-01 16:26               ` Ted Zlatanov
2005-03-01 16:51                 ` Simon Josefsson
2005-03-03 18:04                   ` Ted Zlatanov
2005-03-02  0:39                 ` Katsumi Yamaoka
2005-01-10 19:41   ` IMAP article move David Abrahams
2005-02-25 20:04     ` Ted Zlatanov
2005-03-03 18:05       ` Ted Zlatanov
2005-03-03 19:09         ` David Abrahams
2005-03-04 16:10           ` Ted Zlatanov
2005-03-21  9:32         ` David Abrahams
2005-03-22 19:14           ` Ted Zlatanov
2005-03-22 22:09             ` Simon Josefsson
2005-03-23 19:46               ` Ted Zlatanov
2005-01-11  9:16   ` Bjørn Mork [this message]

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=87mzvgxr41.fsf@obelix.mork.no \
    --to=bmork@dod.no \
    /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).