🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40202

Re: Diablo vs. INN questions...

#40202
From: Russ Allbery
Date: Tue, 28 Sep 1999 00:00
41 lines
2731 bytes
bill davidsen <davidsen@tmr.com> writes:

> C is just not a good string processing language. I would use it for
> something which had to be exceptionally fast, but news filters only need
> to be vary fast, and perl does that well. My timer stats usually show
> history lookup and perl filters use about the same cpu, and I can live
> with that.

With a crappy CPU, that isn't true, yet.  There are some parts of Perl
filtering that really need to be lifted to C.  The MD5 code itself is
already C, of course; the next big speed win will be lifting the binary
check, which can be done far more efficiently in optimized C than by
invoking the full power of a regex engine on it (for one thing, properly
designed you wouldn't have to do *any* backtracking, which is a huge win).

The next big win would be lifting the MD5 fuzziness to C, which would be a
lot harder since it's fairly complex regexes.

After that, everything in my filter is noise; it operates only on headers,
which is equivalently fast in Perl as in C really and in any case fast
enough that other parts of a news server are slow enough to make it
irrelevant.  Cleanfeed may have some other stuff that could be improved,
mostly the badguys body-scanner regexes, but I don't use any of that.

My INN 2.3 test machine is (intentionally) a SPARC 20, so that I can see
the impact of a crappy CPU on the relative timings for various operations.

Sep 28 11:14:21 headwall.Stanford.EDU innd: ME time 600135
idle 369479(70784) artwrite 26850(2561) artlink 0(0) hiswrite 38563(5343)
hissync 169(535) sitesend 8051(4807) artctrl 2260(156) artcncl 2409(166)
hishave 42709(39889) hisgrep 400(65) perl 37291(5240) overv 0(0)

This is typical.  History bites; there has to be a way to speed it up.
(On this particular machine, I'm beating the crap out of a fairly slow
disk with the history file, so I'm not surprised it's so slow.)  I'm
pretty sure that with some work, I can halve that Perl time.

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

Technical Details
Message-ID: <ylwvtalwwi.fsf@windlord.stanford.edu>
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!not-for-mail
References: <brad-2709991944100001@brad.techos.skynet.be> <yl4sggteag.fsf@windlord.stanford.edu> <37f0580c$0$7749@news.execpc.com> <7sr01r$ong$1@newssvr02.news.prodigy.com>

Show Full Headers
Complete Article Headers
Message-ID: <ylwvtalwwi.fsf@windlord.stanford.edu>
Subject: Re: Diablo vs. INN questions...
Date: Tue, 28 Sep 1999 00:00:00 +0000
From: Russ Allbery <rra@stanford.edu>
References: <brad-2709991944100001@brad.techos.skynet.be> <yl4sggteag.fsf@windlord.stanford.edu> <37f0580c$0$7749@news.execpc.com> <7sr01r$ong$1@newssvr02.news.prodigy.com>
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!not-for-mail
X-Deja-AN: 530386381
Organization: The Eyrie
Newsgroups: news.software.nntp