🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #40334

Re: Diablo vs. INN questions...

#40334
From: Kai Henningsen
Date: Fri, 01 Oct 1999 00:00
41 lines
2720 bytes
rra@stanford.edu (Russ Allbery)  wrote on 28.09.99 in <ylwvtalwwi.fsf@windlord.stanford.edu>:

> 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).

Has anyone ever thought about a regex optimizer for Perl? Unless you're  
using exotic features, regexes can actually be compiled not only into a  
nondeterministic finite automaton, which I gather perl does, but into a  
deterministic finite automaton. Which means you no longer need  
backtracking. (Lex does this sort of thing, I believe.)

Compiling to a DFA isn't cheap (but it's also not all that hard to do),  
but when you use it to match huge amounts of data, it still pays.

That would have the advantage of still being able to easily change the  
exact regex.

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

See above.

Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)

Technical Details
Message-ID: <7Q18zfV1w-B@khms.westfalen.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!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> <ylwvtalwwi.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <7Q18zfV1w-B@khms.westfalen.de>
Subject: Re: Diablo vs. INN questions...
Date: Fri, 01 Oct 1999 00:00:00 +0000
From: kaih=7Q18zfV1w-B@khms.westfalen.de (Kai Henningsen)
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> <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
X-Deja-AN: 531350751
X-Fix-Your-Modem: +++ATS2=255&WO1
Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
Organization: Organisation? Me?! Are you kidding?
X-No-Junk-Mail: I do not want to get *any* junk mail.
Newsgroups: news.software.nntp