🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64515

Re: Newsreader programming - sorting one million lines ?

#64515
From: Juergen Helbing
Date: Tue, 25 Mar 2003 06:08
45 lines
2316 bytes
Heiko Studt <UsenetBecky@goldpool.org> wrote:

>Then you save *everything*.

Yes, I'm having all Xover-headers in a single file.

>You save every XOver(?)-Line in one line in a "Direktzugriffs"-file.
>(In a kind of form you like)
>Now you save a pointer to the beginning of the line in a
>fixed-width-record-file.

This is already my actual structure.

>Now you load 10 chars from all subjects to memory and save the index of it.
>Therefor you can use a sorted stringlist. (AFAIK sorting by including is
>fastest, isn't it?). After all you have a pre-sorted list where you have to
>resort all "similar" things with full-width subject, date and so on.

This sounds reasonable and I remember the "5 tape sorting"
from the 50's :-) Reading the entire file once for presorting
and making 'small range sorting' on a smaller file-portion
sounds also good. But there seems to be one big problem:

The "small range sorting" requires access across the entire
file (The similar subject is used everywhere within one gig
of headers). And these disk-accesses are very slow....

>This is a smaller solution in Delphi:
>[...]
>      tsl.AddObject(GetSortingItems(s), tObject(temI));
>[...]

The "GetSortingItems(s)" seems to include an 
"fseek(randompostion-within-fullfile)"... and this is
used 1e6 times....  Having a fast disk with 1 mSec 
access to every item would still need 1000 seconds....

Obviously the required time for "external sorting" is
not acceptable.....

Thanks for your answer.
-- 
Juergen

Technical Details
Message-ID: <53087.p33205@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.alt.net!usenet
References: <4540d.o33203@archiver.winews.net> <b5nnpr.180.1@Heiko.Studt.dialin.t-online.de>

Show Full Headers
Complete Article Headers
Message-ID: <53087.p33205@archiver.winews.net>
Subject: Re: Newsreader programming - sorting one million lines ?
Date: Tue, 25 Mar 2003 06:08:53 +0000
From: archiver@i3w.com (Juergen Helbing)
References: <4540d.o33203@archiver.winews.net> <b5nnpr.180.1@Heiko.Studt.dialin.t-online.de>
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.alt.net!usenet
Newsgroups: news.software.nntp
Organization: Altopia Corp. - Usenet Access - http://www.altopia.com
Lines: 44
X-Newsreader: MyNews