Gnus development mailing list
 help / color / mirror / Atom feed
From: Paul Franklin <paul@cs.washington.edu>
Subject: Re: Nntp inefficiencies
Date: 29 Oct 1998 11:43:38 -0800	[thread overview]
Message-ID: <r9q67d3887p.fsf@sequoia.cs.washington.edu> (raw)
In-Reply-To: Kurt Swanson's message of "Thu, 29 Oct 1998 12:13:31 GMT"

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]

>>>>> Kurt Swanson writes:

 > Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

 >> and when `g'-ing, to get the real number of unread
 >> articles in the group buffer.  The latter would probably take far too
 >> long, though, to be of any use.

 > No, this wouldn't be good, but we could get the desired information
 > much easier - enter the group (in nntp parlance).  It seems that the
 > entire universe in the gnus-plane is based upon the response to the
 > nntp command, "LIST ACTIVE «group-name»".  The active files for mail
 > groups and for the cache have the same format as the output from this
 > command:
 >   "«group-name» «highest-article-number» «lowest-article-number» y"
 > I have no idea what purpose the "y" is for, well maybe it's a
 > moderation flag? If one instead entered the group via:
 >   "GROUP «group-name»",
 > the response one gets is
 >   "211 «number-available» «lowest» «highest» «group-name»"

 > This is of course an O(1) operation, instead of the O(n) LISTGROUP,
 > when one is only interested in the number of available articles.

 > It would be nice if the entire gnus-plane used the GROUPS sort of
 > format - including the number of articles in the range.  This is
 > especially useful in mail groups and caches.  For instance, I keep a
 > special nnml group for all email which needs my attention to which I
 > have not responded.  Many times my attention can't be given for
 > months, and despite my usually never having more than 20-30 such
 > messages, the difference between max & min article number is often >
 > 200.  Thus I am often queried if I really want to bring up 231 (or
 > whatever) messages, when there are in reality only 17...

Yup; a lot of people have requested something like this.  And Lars
keeps saying that it's too hard to compute, in a variety of
circumstances.  But I think there's another way...

By caching a tiny bit of extra information, Gnus can make a much
better guess at an article count.  Suppose that whenever you exit a
group, it records the actual article count, and the «highest»
article number according to the active file.  Call these cached
values CCount and CHi.

CCount now tells us how many articles are actually below CHi.

Then we do a "g".  We now have new values Lo and Hi.  We can now
calculate an article count:
	CHi = max(CHi, Lo-1)
	count = CCount + (Hi - CHi)
This article count is still not exact, but it's a lot closer.

For nntp groups, this avoids entering the group.  (Is this always
fast enough that it's a non-issue?)  But the real win is other
groups.  Lars hasn't wanted Gnus to go through the unread article
ranges on the fly and compute a real article count.  But since
articles should only disappear from mail groups while in a group or
while in a group or while running expiry, it should be pretty easy
to keep this data totally up to date.

I might have time the week after next to hack on this...

--Paul


  parent reply	other threads:[~1998-10-29 19:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6f67d62e2s.fsf@dna.lth.se>
1998-10-29 10:25 ` Lars Magne Ingebrigtsen
     [not found]   ` <6fpvbbo9ed.fsf@dna.lth.se>
1998-10-29 19:43     ` Paul Franklin [this message]
1998-10-31 14:11       ` Lars Magne Ingebrigtsen
1998-10-31 22:18         ` David Hedbor
     [not found]         ` <6fg1c3ef1i.fsf@dna.lth.se>
1998-11-07 14:02           ` Lars Magne Ingebrigtsen
     [not found]             ` <6fu30as9mo.fsf@dna.lth.se>
1998-11-08 12:37               ` Lars Magne Ingebrigtsen
     [not found]                 ` <6fogqixnli.fsf@dna.lth.se>
1998-11-08 15:31                   ` Lars Magne Ingebrigtsen
1998-11-09  6:41                     ` Yair Friedman
1998-11-10  4:41                       ` Lars Magne Ingebrigtsen
1998-11-09 17:58                     ` Paul Franklin
1998-11-10  4:47                       ` Lars Magne Ingebrigtsen
     [not found]                     ` <6fk9159ru6.fsf@dna.lth.se>
1998-11-10  4:44                       ` Lars Magne Ingebrigtsen
     [not found]                         ` <6femrc3pig.fsf@dna.lth.se>
     [not found]                           ` <m3ogqbmkgp.fsf@sparky.gnus.org>
1998-11-14 12:21                             ` Kurt Swanson
1998-11-08 17:00                 ` Alan Shutko
1998-11-08 21:30                   ` Lars Magne Ingebrigtsen
1998-10-31 14:11     ` Lars Magne Ingebrigtsen

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=r9q67d3887p.fsf@sequoia.cs.washington.edu \
    --to=paul@cs.washington.edu \
    /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).