Article View: news.software.nntp
Article #64532Re: Newsreader programming - sorting one million lines ?
From: Juergen Helbing
Date: Wed, 26 Mar 2003 07:13
Date: Wed, 26 Mar 2003 07:13
129 lines
6185 bytes
6185 bytes
DS <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote: >Can I put in my two cents? Of course - that's why I am asking the group :-) >First question- Do you mean 1.5 million msg's ? >That's ALOT of msg's, or any type of data to sort. Yes. And if you believe that this would be ridiculous: Some newsgroups are having already _today_ 30.000 and more headers per day. The volume (and the headers) will continue to grow. And it seems to be one of the major requirements to _combine_ several newsgroups into one (folder) - especially if they contain similar topics (or are often used for xposts). I am myself scanning some newsgroups only once a week. And after a two week vacation most large binary groups I'm scanning today cause already an overflow (of my internal 150.000 lines limit). With a retention of 30-60 days I am using myself the amount of headers is enormous. Earlier or later more newsreader programmers will have similar problems (or did solve them already). >There it is, the 'cat's out of the bag'. I was putting off and putting >off letting people know I was using Jet, thru VB none the less for my >project. Go ahead, laugh, I know it's coming. Perception's of VB vs. C++. Programming is a question of clue and libs - not of the used language :-) Our professors smiled when we started learning BASIC for PET2001 but they changed their mind quickly when they recognized that computer science was not limited to 'Pascal' ;-) >So anyway, I get 'acceptable' performance from the Jet engine. The main >issue's in performance are downloading header's. My IP meter tells me >that I top out at about 1 mBit/sec with 5-6 threads d/l'g after XOVER >command's. That include's receiving a packet, parsing out each header >dataset, breaking out each dataset into it's relevant parts, fully >processing the subject line for multi-part detection (not joined at this >juncture), looking in the database to see if it's there already, and >adding it if not. If you are able to process 2000-3000 headers per seconds then you are doing a great job. >After all server's are processed for a specific group, a seperate process >is spawned which goes thru that group's db and join's multi-part's, >mark's complete or not, expires parts that are off the server(s), yadda >yadda yadda.... For smaller groups this outside process takes 1-2 >seconds. For the larger groups 6-8. It is at this point that the info is >ready for use and can be diplayed. Joining and expiry ? I'm deeply impressed. It seems that you are running a very fast PC-machine. >Additionally, all sorting and >filtering is done by Jet and not me. I just pass an SQL open statement, >and receive the data I want, sorted how I want, from the groups I want. >Jet is WAYYYYYYYYY more efficient than I could ever be. You are using the approach to keep all necessary sorting indices on the harddisk. It would be really interesting to know how this performs after some weeks of operation when the disk is fully fragmented. But the jet-database engine might be powereful enough to solve all those problems externally. >What I can tell you is that querying that virtual group, it takes about >25 seconds for me to open the db, filter out what is NOT to be shown & >sort, and display it in the virtual listview. Out of the 150,000 ish >headers, some 5500 or so were actually displayed being either text >messages, or a single header for a multipart download. Subsequently, each >column-header click done to re-sort that group in a different manner >takes 3-4 seconds. A re-sort closes the entire table and open the new >recordset with the new sort. In the 3-4 seconds. Very impressive numbers. >When ZaNews is re-written in C++, I estimate a 15% - 25% increase in >speed. I have come up with this number as an opinion formed by reading >many bench mark tests for 'other' database engine controls comparing >their performance between using it is VB or C++. I dont believe that you'll see any improvements in speed: VB and C++ are similar compilers - and the speed gains for C++ are usually caused by lack of plausibility checks. So your C++ version might be even more unstable. And most work is done on the harddisk-subsystem and the external database - which wont be faster. So if I were you then I would not transpile the software from VB to C. >OK, everyone can laugh now about VB and Jet here. But I'll tell you, so >far it's been working. Header downloads is the only 'very high' overhead >that is done. And once you start d/l'g and managing parts and such, the >actual db action should be quite light. There is no reason to be ashame. You've done a great job and sharing your experience might be very helpful for other programmers. >PS- I don't really think I answered his question even....sorry. You did: you've demonstrated me that an external database can be very efficient for the problem solution. And that updating headers after retrieval and expiry _can_ be done very fast even if all sorting is also kept and maintained on the disk. So the consequence for me would be to implement a database for the headers..... (or to use an external one as you did)... Thanks for taking the time for your detailled report. It was a pleasure to read it. -- Juergen
Technical Details
Message-ID:
<20138.q3320a@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!usenetReferences:
<4540d.o33203@archiver.winews.net> <Xns93498CE88447Aidispcom@24.48.107.54>Show Full Headers
Complete Article Headers
Message-ID: <20138.q3320a@archiver.winews.net> Subject: Re: Newsreader programming - sorting one million lines ? Date: Wed, 26 Mar 2003 07:13:20 +0000 From: archiver@i3w.com (Juergen Helbing) References: <4540d.o33203@archiver.winews.net> <Xns93498CE88447Aidispcom@24.48.107.54> 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: 128 X-Newsreader: MyNews