🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64545

Re: Newsreader programming - sorting one million lines ?

#64545
From: Jeffrey M. Vinocur
Date: Thu, 27 Mar 2003 01:14
54 lines
3106 bytes
In article <11387.q33208@archiver.winews.net>,
Juergen Helbing <archiver@i3w.com> wrote:
>Heiko Studt <UsenetBecky@goldpool.org> wrote:
>
>>> used 1e6 times....  Having a fast disk with 1 mSec 
>>> access to every item would still need 1000 seconds....
>>
>>A fast disc should AFAIK even be faster... ;-P
>
>AFAIK it would be even slower.

Keep in mind that if you use an appropriate algorithm, you
shouldn't need random access.  And linear access can be cached
quite nicely by your operating system (and the drive itself).


>If I understand you correctly then I'm reading the Xover file sequentially.
>I'm extracting the first N chars of the sort item (as hash) and keep them 
>sorted in memory. Sounds all very good.
>If I find an item with an identical hash now then it is necessary to 
>reload all the items with the identical hash and compare then fully
>to the current item to sort.
>Now the problem: This could be a lot in the newsgroups: 
>Many Subject - or From lines have identical first 10 chars.

Of course, if you know what parts of the Subject are likely to be
the multipart [x/y] indicator, you could do multipart recombining
before sorting (using a hashtable, with a hash function on all of
the string except for "x").


>Our problems when we are writing news-readers and new-servers
>are so specific (and demanding) that news.software.nntp would be
>the only newsgroup where things are really understood.

I strongly disagree here.  If you go to a good computer scientist
and say "Here is a very precise specification for my problem:  I
have this much data, and it changes at such-and-such a frequency,
and I need to support the following operations" then you will
receive an appropriate answer.


>If any of the elders or admins believes that the discussion of
>my question would belong to another newsgroup, then please
>let me know. 

I don't *mind* -- but I think you'd have more _success_
elsewhere.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID: <b5tj8r$db5$2@puck.litech.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.litech.org!not-for-mail
References: <4540d.o33203@archiver.winews.net> <b5pkd8.1kg.1@Heiko.Studt.dialin.t-online.de> <11387.q33208@archiver.winews.net>

Show Full Headers
Complete Article Headers
Message-ID: <b5tj8r$db5$2@puck.litech.org>
Subject: Re: Newsreader programming - sorting one million lines ?
Date: Thu, 27 Mar 2003 01:14:03 +0000
From: jeff@litech.org (Jeffrey M. Vinocur)
References: <4540d.o33203@archiver.winews.net> <b5pkd8.1kg.1@Heiko.Studt.dialin.t-online.de> <11387.q33208@archiver.winews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.litech.org!not-for-mail
Newsgroups: news.software.nntp
Organization: Litech Systems Design
Lines: 53
Sender: jeff@litech.org
NNTP-Posting-Host: 66.218.0.75
X-Trace: puck.litech.org 1048727643 13669 66.218.0.75 (27 Mar 2003 01:14:03 GMT)
X-Complaints-To: usenet@litech.org
NNTP-Posting-Date: Thu, 27 Mar 2003 01:14:03 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: jeff@litech.org (Jeffrey M. Vinocur)