Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Spam processing slows down group exit (was: Profiling)
Date: Thu, 01 Jan 2004 14:51:27 +0100	[thread overview]
Message-ID: <v9pte3u68w.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <m3u13j3qiq.fsf@quimbies.gnus.org>

On Tue, Dec 30 2003, Lars Magne Ingebrigtsen wrote:

> Gnus was feeling a bit more sluggish than usual, so I've spent a
> couple of hours profiling and fixing obvious things.

I noticed that leaving large nntp or nnml groups became kinda slow (I
didn't profile it, though).

I found that the group and topic parameters (spam/ham) are
calculated[1] for *every article* rather than once for each group
exit.  I have set up spam processing for some IMAP groups and all
Gmane groups[2], but not for nnml (and other nntp groups).

I added the following debug statements in `spam-group-ham-mark-p'...

  (gnus-message 9 "DEBUG: spam-group-ham-mark-p %s %s %s" group mark spam)

... and got the following output after leaving a group with 10
articles (entered with `10 RET'):

,----
| Exiting summary buffer and applying spam rules
| DEBUG: spam-group-ham-mark-p nnml+foo:bar 69 t [9 times]
| DEBUG: spam-group-ham-mark-p nnml+foo:bar 33 t
| DEBUG: spam-group-ham-mark-p nnml+foo:bar 69 nil [9 times]
| DEBUG: spam-group-ham-mark-p nnml+foo:bar 33 nil
| Marking spam as expired without moving it
`----

The function seems to be called from `spam-ham-copy-or-move-routine':

    (dolist (article articles)
      (when (spam-group-ham-mark-p gnus-newsgroup-name
				   (gnus-summary-article-mark article))
	(push article todo)))

Couldn't each possible mark be checked _once_ per group exit instead
once for every article?  (==> O(1) instead of O(n), AFAIKS.)

Why is `spam-ham-copy-or-move-routine' called in the first place?  I
have not requested any spam processing in this group.

Bye, Reiner.

[1] Using C-g after toggle-debug-on-quit, I saw that Gnus was doing
    this most of the time.

[2] See also <news:v94qw3y46d.fsf@marauder.physik.uni-ulm.de>:

   ("nnimap:spam\\.detected"
    (gnus-article-sort-functions '(gnus-article-sort-by-chars))
    (ham-process-destination "nnimap:INBOX" "nnimap:training.ham")
    (spam-contents gnus-group-spam-classification-spam))
   ("nnimap:\\(INBOX\\|other-folders\\)"
    (spam-process-destination . "nnimap:training.spam")
    (spam-contents gnus-group-spam-classification-ham))

   ("^gmane\\."
    (spam-process (gnus-group-spam-exit-processor-report-gmane)))
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




  parent reply	other threads:[~2004-01-01 13:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-30  3:58 Profiling Lars Magne Ingebrigtsen
2003-12-30  5:06 ` Profiling Kevin Greiner
2003-12-31  1:39   ` Profiling Lars Magne Ingebrigtsen
2004-01-04 15:37     ` Profiling Per Abrahamsen
2004-01-04 20:41       ` Profiling Lars Magne Ingebrigtsen
2003-12-31  1:49 ` Profiling Michael Cook
2004-01-03 16:56   ` Profiling Robert Marshall
2004-01-01 13:51 ` Reiner Steib [this message]
2004-01-02 16:08   ` Spam processing slows down group exit Ted Zlatanov
2004-01-02 18:40     ` Reiner Steib

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=v9pte3u68w.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /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).