🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #4820

Re: INN & Xover with Xref:'s (was Re: TIN Xref patch (01/01))

#4820
From: Pope Clifton
Date: Tue, 06 Jul 1993 09:34
93 lines
4420 bytes
Iain Lea (iain.lea@anl433.erlm.siemens.de) wrote:
: Tom J Parry (parry@yoyo.cc.monash.edu.au) wrote:
: : Iain Lea (iain.lea@anl433.erlm.siemens.de) wrote:
: : >
: : > 32) Herman ten Brugge (herman@htbrug.hobby.nl)
: : >     BUG. Xref: article headers are not processed so crossposted
: : >          articles are not marked as read in other newsgroups.
: : >     FIX. tin.h newsrc.c group.c page.c - applied supplied patch.
: ;
: : Iain, you said that you would be modifying the patch so it was not so disk
: : intensive? Did you manage to do this?Killing a thread with a few followups
: : is quite slow with the patch as posted.

: Yes & no.  The reason it was so slow was that it was reopening
: every unread article and reading the Xref: line.  Not exactly
: a free lunch considering I parse each article header to begin
: with.  ...

I found another major source of performance problems with the local (NFS)
and local indexes implementation here.  The code to parse the article
headers was using a very non-optimal method of determining the number of
lines and bytes per article, namely scanning through the whole thing.  I am
posting a patch which goes on top of the XRef patch, to make it get the
lines from the "Lines:" field, and the byte count using fseek/ftell.  This
speeds up indexing dramatically.

The XRef patch actually had several changes bundled into it, like this whole
byte count/line count on thread selection, etc.  It's made it a little
harder to evaluate, but I can live with it.

There seems to be one more major slow point in between finishing indexing
and starting threading; I haven't tracked that down yet, but maybe in
another week or two...  It's late at night and I'm rambling.  Here's the
patch.
  -- Clifton

====== BEGIN PATCH =============================
*** art.c.xrf	Tue Jul  6 02:14:15 1993
--- art.c	Tue Jul  6 02:14:33 1993
***************
*** 581,604 ****
  					}
  				}
  				break;
  		}

  		if (! flag || lineno > max_lineno || got_archive) {
! 			while (*ptr) {
! 				if (*ptr++ == '\n')
! 					lineno++;
! 			}
! 			while ((n = fread (buf, 1, sizeof (buf)-1, fp)) > 0) {
! 				buf[n] = '\0';
! 				bytecnt += n;
! 				ptr = buf;
! 				while (*ptr) {
! 					if (*ptr++ == '\n')
! 						lineno++;
! 				}
! 			}
! 			h->linecnt = lineno;
! 			h->bytecnt = bytecnt;
  			if (got_from && got_date) {
  				if (! got_subject) {
  					h->subject = hash_str ("<No subject>");
--- 581,601 ----
  					}
  				}
  				break;
+ 			case 'L':	/* Lines:  optional */
+ 				/* A better way to get the line count -- Clifton */
+ 				if (! h->linecnt ) {
+ 					if (match_header (ptrline, "Lines", buf2, HEADER_LEN)) {
+ 						sscanf( buf2, "%ld", &(h->linecnt) );
+ 					}
+ 				}
+ 				break;
  		}

  		if (! flag || lineno > max_lineno || got_archive) {
! 			/* A better way to get the byte count -- Clifton */
! 			fseek( fp, 0, 2 );
! 			h->bytecnt = ftell( fp );
! 			
  			if (got_from && got_date) {
  				if (! got_subject) {
  					h->subject = hash_str ("<No subject>");
====== END PATCH ===============================

--
cliftonr@netcom.com     Home: +1 808 521 9073  Work: +1 808 625 3234
Clifton Royston, Pope of the Church of the Subgenius in Paradise
    Them helpis no conclusionis sle / Timor mortis conturbat me.
Technical Details
Message-ID: <cliftonrC9qLAA.FwK@netcom.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!dearn!frmop11.cnusc.fr!taloa.unice.fr!univ-lyon1.fr!ghost.dsi.unimi.it! batcomputer!caen!spool.mu.edu!olivea!hal.com!decwrl!csus.edu!netcom.com!cliftonr
References: <1993Jun23.073355.22043@anl433.uucp> <1993Jun23.113328.29540@monu6.cc.monash.edu.au> <1993Jun23.202904.2308@anl433.uucp> <C94D3F.Hox@liverpool.ac.uk> <cliftonrC967Ay.2Dp@netcom.com> <C96L9n.GG9@liverpool.ac.uk> <1993Jun26.145052.7236@anl433.uucp> <1993Jun28.131323.9976@monu6.cc.monash.edu.au> <20mvi1$oth@Germany.EU.net>

Show Full Headers
Complete Article Headers
Message-ID: <cliftonrC9qLAA.FwK@netcom.com>
Subject: Re: INN & Xover with Xref:'s (was Re: TIN Xref patch (01/01))
Date: Tue, 6 Jul 1993 09:34:58 GMT
From: cliftonr@netcom.com (Pope Clifton)
References: <1993Jun23.073355.22043@anl433.uucp> <1993Jun23.113328.29540@monu6.cc.monash.edu.au> <1993Jun23.202904.2308@anl433.uucp> <C94D3F.Hox@liverpool.ac.uk> <cliftonrC967Ay.2Dp@netcom.com> <C96L9n.GG9@liverpool.ac.uk> <1993Jun26.145052.7236@anl433.uucp> <1993Jun28.131323.9976@monu6.cc.monash.edu.au> <20mvi1$oth@Germany.EU.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!gmd.de!dearn!frmop11.cnusc.fr!taloa.unice.fr!univ-lyon1.fr!ghost.dsi.unimi.it! batcomputer!caen!spool.mu.edu!olivea!hal.com!decwrl!csus.edu!netcom.com!cliftonr
Newsgroups: news.software.readers
Organization: Inst. for Epistemological Pathology
X-Newsreader: TIN [version 1.2 PL0]
Lines: 93