🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #4969

Re: Tin v1.2 PL1 Slooooowww ?

#4969
From: John Schmitz
Date: Fri, 16 Jul 1993 22:54
81 lines
2762 bytes
> The responsible line of code is in open.c:
> 	count = last - start;
> Changing it back to:
> 	start = last - count;
> will restore the previous behavior, but you will lose (old) articles (if 
> you would not lose them it would not be so slow).

This is disastrous if you have a sparesly populated group for
whatever reason.  On problem with tin is that if you have a faq near
the front of the group, tin will go searching in a linear fashion
for possible articles.  This is part of the performance hit after
the above change to open.c was made so all articles would be
visible.

A possible change is to put in a binary search like the one below.
Further, though, I don't know why tin can't just believe the
overview data and not go searching in its own arrays.

RCS file: RCS/art.c,v
retrieving revision 1.1
rdiff -c -r1.1 art.c
*** /tmp/,RCSt1a16216	Fri Jul 16 15:53:16 1993
--- art.c	Wed Jul 14 12:30:47 1993
***************
*** 91,97
   *  Do we have an entry for article art?
   */
  
! int valid_artnum (art)
  	long art;
  {
  	register int i;

--- 91,97 -----
   *  Do we have an entry for article art?
   */
  
! int old_valid_artnum (art)
  	long art;
  {
  	register int i;
***************
*** 105,110
  	return -1;
  }
  
  /*
   *  Return TRUE if arts[] contains any expired articles
   *  (articles we have an entry for which don't have a 

--- 105,134 -----
  	return -1;
  }
  
+ int valid_artnum (art)
+ 	long art;
+ {
+ 	register int prev, range;
+ 	register int dtop = top;
+ 	register int cur = 1;
+ 
+ 	while (dtop /= 2) cur = cur << 1;
+ 	range = cur / 2;
+ 	cur--;
+ 	while (1) {
+ 		if (arts[cur].artnum == art)
+ 			return cur;
+ 		prev = cur;
+ 		if (arts[cur].artnum < art) {
+ 			cur = cur + range;
+ 		} else {
+ 			cur = cur - range;
+ 		}
+ 		if (prev == cur || cur >= top) return -1;
+ 		range = range / 2;
+ 	}
+ }
+ 
  /*
   *  Return TRUE if arts[] contains any expired articles
   *  (articles we have an entry for which don't have a 
Technical Details
Message-ID: <227bk1INNfr0@hpsceo.scd.hp.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!xlink.net!sol.ctr.columbia.edu!math.ohio-state.edu!sdd.hp.com!hpscit.sc.hp.com!news
References: <1993Jul15.133328.5809@bnr.ca> <225q5jINNlcq@rs2.hrz.th-darmstadt.de>

Show Full Headers
Complete Article Headers
Message-ID: <227bk1INNfr0@hpsceo.scd.hp.com>
Subject: Re: Tin v1.2 PL1 Slooooowww ?
Date: Fri, 16 Jul 1993 22:54:57 +0000
From: schmitz@scd.hp.com (John Schmitz)
References: <1993Jul15.133328.5809@bnr.ca> <225q5jINNlcq@rs2.hrz.th-darmstadt.de>
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!xlink.net!sol.ctr.columbia.edu!math.ohio-state.edu!sdd.hp.com!hpscit.sc.hp.com!news
Newsgroups: news.software.readers
Organization: Hewlett-Packard Santa Clara Division
Lines: 81
NNTP-Posting-Host: hpsceo.scd.hp.com