Forum OpenACS Development: I'm to blame

Collapse
12: I'm to blame (response to 1)
Posted by David Rodriguez on

I wrote the perl version of watchdog.

The original version of watchdog was written all in tcl as a stand-alone aolserver service (like rollover). It was terribly slow. Processing a 1-meg span of error log took nearly 15 minutes. Rewritten as a perl script, that dropped to around 1 second.

This was back in the tcl 7.6 days, and the problem was that the old code relied on long lists (which were slow in 7.6), and many regexps, at least one for every line being read. Also, tcl 7.6 didn't pre-compile, which is a performance killer for an app that is basically a collection of regexps that get executed in a small loop many times.

Don said this is the type of job that tcl is made for. This is basically a text-munging job, and when I think of text-munging, I think of perl (I don't think I'm alone.). I knew perl didn't suffer from the two weakness that made the old code slow.

Another reason it's in perl is because I didn't know about the performance improvements that existed in 8.x at the time. Like most people at aD, my only interaction with Tcl was through AOLserver, so I never considered writing it as a tcl script to be exec'ed by a 8.x tclsh (which seems odd, but was probably the only way to get acceptable performance out of tcl for this task at the time.)

And regarding Jon's comment...

The original reason that this was written in Perl was that someone told the MIT boys that "perl==secure tcl==security flaw"

I've never met Jon, and I've certainly never talked to him about watchdog. I'm not sure where he gets his information.