Gnus development mailing list
 help / color / mirror / Atom feed
* optimizing `A T' via nnir in imap groups
@ 2011-10-08  2:14 Dave Abrahams
  0 siblings, 0 replies; only message in thread
From: Dave Abrahams @ 2011-10-08  2:14 UTC (permalink / raw)
  To: ding


I noticed that `A T' was taking a very long time for some articles, even
though I'm running against a local dovecot server.  I made this hack to
nnimap which limits the number of references it will search to 5, and it
sped up considerably (**).

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 77372c2..0ac6889 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1983,9 +1983,10 @@ textual parts.")
 
 (defun nnimap-make-thread-query (header)
   (let* ((id  (mail-header-id header))
-	 (refs (split-string
+	 (refs1 (split-string
 		(or (mail-header-references header)
 		    "")))
+         (refs (nbutlast refs1 (- (length refs1) 5)))
 	 (value
 	  (format
 	   "(OR HEADER REFERENCES %S HEADER Message-Id %S)"
--8<---------------cut here---------------end--------------->8---

In theory, if all agents behave themselves, you should only need the
first message-id from the References header.  Of course we know that
they don't behave in real life, but maybe we should make this a
customizable option, so people can trade speed against completeness of
the result.  Probably it should be set to something reasonable rather
than "no-limit."  I fear for the person who does `A T' on a leaf of a
thread with hundreds of messages.

(**) 2 was /really/ fast but it missed some articles in one of my
searches.  That was visually obvious, though, and I could fix it easily
by going to the earliest article I *did* get and running the command
again.  Personally I'll probably set it back to 2.

Thoughts?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-08  2:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-08  2:14 optimizing `A T' via nnir in imap groups Dave Abrahams

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).