🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Samiad Wed, 12 Feb 2003 01:00
sort headers by subject algorithm
#64002
Author: Samiad
Date: Wed, 12 Feb 2003 01:00
15 lines
1409 bytes
Hello all,

I am currently investigating suitable algorithms for generating a
typical threaded view for newsgroup headers, sorted by subject.  The
sort your conventional newsgroup reader might use (replies go just
below the replied message).

This is also the same sort of thing used in web bulletin board
systems.

Can anyone point me to a resource where I can examine such code?  Any
language or pseudocode would be perfect!

Thanks,
Re: sort headers by subject algorithm
#64003
Author: Jesper Harder
Date: Wed, 12 Feb 2003 01:21
10 lines
1479 bytes
ylsf@hotmail.com (Samiad) writes:

> I am currently investigating suitable algorithms for generating a
> typical threaded view for newsgroup headers
>
> Can anyone point me to a resource where I can examine such code?  Any
> language or pseudocode would be perfect!

See <http://www.jwz.org/doc/threading.html>
Re: sort headers by subject algorithm
#64005
Author: J.B. Moreno
Date: Wed, 12 Feb 2003 03:20
25 lines
1810 bytes
In article <3e499c1d.56495214@news.claranews.net>, 
 Samiad <ylsf@hotmail.com> wrote:

> Hello all,
> 
> I am currently investigating suitable algorithms for generating a
> typical threaded view for newsgroup headers, sorted by subject.  The
> sort your conventional newsgroup reader might use (replies go just
> below the replied message).
> 
> This is also the same sort of thing used in web bulletin board
> systems.
> 
> Can anyone point me to a resource where I can examine such code?  Any
> language or pseudocode would be perfect!

First off, you're not actually talking about sorting, you're talking
about threading -- you can do it as a sorting (sorta) using the
References header, but not using the Subject.

Anyway, take a look at the code in trn, slrn, or tin.

-- 
J.B. Moreno
Re: sort headers by subject algorithm
#64008
Author: Colin Wilson
Date: Wed, 12 Feb 2003 10:06
28 lines
1822 bytes
Samiad wrote:

> I am currently investigating suitable algorithms for generating a
> typical threaded view for newsgroup headers, sorted by subject.  The
> sort your conventional newsgroup reader might use (replies go just
> below the replied message).
> 
> This is also the same sort of thing used in web bulletin board
> systems.
> 
> Can anyone point me to a resource where I can examine such code?  Any
> language or pseudocode would be perfect!

Have a look at http://www.jwz.org/doc/threading.html for Jamie 
Zawinski's threading algorithm.  There's pseudocode there.

XanaNews uses this algorithm for it's threading.  It's free and comes 
with source in Delphi, so you can have a look at how I implement it, 
too.


-- 
Colin
e-mail :colin@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

Posted with XanaNews 1.13.2.6
Re: sort headers by subject algorithm
#64028
Author: Colin Wilson
Date: Thu, 13 Feb 2003 10:27
57 lines
3558 bytes
Adbn Eti`n wrote:

> Nice newsreader Colin! Compliments.  I've been running XanaNews for a 
> few days, it's an ok newsreader for light work but there are some 
> issues, the threading works fine but the database issue addressed by 
> Jamie Zawinski must be <partly> wrong.  

> ( why is there no default  'autosave'  for writing a file attchment? 

I'll put it in a future release.

> That eats even more memory and throws an exception - to often  ;)

Obviously I'm keen to track down any exceptions, excessive memory usage,
 etc.  If you like, please supply details in the xananews.support 
newsgroup on the forums.talkto.net server.  Although XanaNews holds all 
the headers for the selected group in memory, it doesn't hold all the 
message bodies (including attachments) in memory - just the 5 most 
recently viewed.

> [!quotes]
> ! My C version of this code was able to thread 10,000 messages in 
> less than half ! a second on a low-end (90 MHz) Pentium, so the 
> argument that it has to be in ! the database for efficiency is pure 
> bunk. 
> 
> No bunk, I cannot get a 600mhz pentium to reorder 10,000 articles 
> into threads in Seconds!  Not with XanaNews or any other windows 
> newsreader for that matter.

Last night I downloaded all 27000 messages from uk.rec.motorcycles into 
XanaNews.  I'd modified it so that it beeped at the start and end of 
the threading code.  It takes less than a second to thread the 27000 
articles on my 1Ghz PIII.  Of course there are other overheads when 
switching groups - it has to unload the message headers for the 
previously selected group; load the message headers for the newly 
selected one, then finally thread them.  This takes XanaNews about 3 
seconds for a 27000 thread group.  BTW, it took 17 minutes to download 
the 27000 full messages on my ADSL connection - about 1500 per minute.

But you're right.  Holding headers for a group in memory and threading 
them on-the-fly will cause performance problems if there are too many 
messages, and if you want to hold big archives of newsgroup messages 
then ultimately these in-memory newsreaders - including XanaNews - may 
not be right for you.  OK - it has 'archived message' folders that 
don't get loaded into memory all at once, into which you can put 
archives of old messages, but they don't work very well or efficiently 
at the moment.


-- 
Colin
e-mail :colin@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

Posted with XanaNews 1.13.2.6
Re: sort headers by subject algorithm
#64037
Author: Heiko Studt
Date: Thu, 13 Feb 2003 23:34
56 lines
3261 bytes
Colin Wilson did nothing on 13.02.2003 11:27:02:

> Last night I downloaded all 27000 messages from uk.rec.motorcycles into 
> XanaNews.  I'd modified it so that it beeped at the start and end of 
> the threading code.  It takes less than a second to thread the 27000 
> articles on my 1Ghz PIII.  

I have written threading-code too in a searchtool for Hamster (Delphi).

Extract/Show(list) the needed Headers out of database 
                          (something like MBox-format)
  ~8-15 Seconds

Threading without Show
  <1 Second (Beeps)

Threading +Show complete(see bottom)
  ~20 Seconds


So it took too long to load and show the threads, but generating the threads
don't need that much time too.

BTW: Because of you I enhanced the code so that for showing the treeview, 
     it doesn't need to include the complete tree anymore. So it needs now 
     around 13 Seconds together with loading. Thank you! :)

> Of course there are other overheads when 
> switching groups - it has to unload the message headers for the 
> previously selected group; load the message headers for the newly 
> selected one, then finally thread them.  This takes XanaNews about 3 
> seconds for a 27000 thread group.  BTW, it took 17 minutes to download 
> the 27000 full messages on my ADSL connection - about 1500 per minute.

ACK, it should not take *too* much time.

> But you're right.  Holding headers for a group in memory and threading 
> them on-the-fly will cause performance problems if there are too many 
> messages, and if you want to hold big archives of newsgroup messages 

NAK.
It depends on what you hold in memory.
I only have Subject, From, Date, Size and References/MID saved. So it took
only some MBs.
With 22.800 Messages I need 19 MB, so around 1 MB for 1000 Messages.
But without any message it needs around 5 MBs alone, so it's even less.
Deleting References could perhaps help. 



MFG

-- 
Heiko Studt

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads