[Mailman-Developers] bugtraq submission warning: email address harvesting exploit

Bernhard Kuemel darsie at gmx.at
Wed Nov 26 05:36:23 EST 2003

Richard Barrett wrote:
>> Maybe. However, I don't like python as on our old P60 server it burned 
>> up so much CPU time (15 s/min).
> It would be interesting to see you present convincing evidence that 
> Python runs slower than Perl which you seem happy to rely on.

That can be difficult as different programming languages are 
designed for different tasks so they all have their strengths and 
weaknesses. That also pretty much makes such a comparison 
senseless. It would e.g. be a good choice to make an mp3 encoder 
in C and my mailman exploit in perl and not the other way round. 
I would without doubt claim that C runs faster and many tasks are 
coded quicker in perl.
It is my impression that python is slow, at least it has a 
lengthy startup. It may still be suitable for certain tasks, 
however I have no idea which as I don't speak python. Mailman was 
run once per minute from cron on my old server. Maybe Mailman was 
coded inefficiently. However, I read it scales better than 
Majordomo, a perl program. That difference is probably a design 
issue rather than to blame on the programming language.

Anyways, since you asked for a benchmark, here is a quick start. 
These programs were run repeatedly so the perl interpreter was 
already loaded from disk and cached. The shortest run was picked 
to minimize interference from other processes.

Detected 735.005 MHz processor.
Calibrating delay loop... 1468.00 BogoMIPS
CPU: Intel Celeron (Coppermine) stepping 06

bernhard at b:~/t$ time perl -e 'print "hello world\n";'
hello world

real    0m0.017s
user    0m0.000s
sys     0m0.010s

This shows the small overhead on perl startup.

bernhard at b:~/t$ time perl -e 'for ($i=1;$i<=1000000;$i++) {print 
"$i: hello world\n";}' >/dev/null

real    0m2.147s
user    0m2.090s
sys     0m0.010s

A million string interpolations and file accesses in 2.1 s - not bad.

Compare this to C:

int main(void) { puts("hello world"); }

bernhard at b:~/src/benchmark$ time ./hello
hello world

real    0m0.007s
user    0m0.000s
sys     0m0.000s

#include <stdio.h>
int main(void) {
int i;
for (i=1;i<=1000000;i++) {
         printf("%d: hello world/n",i);
} //main

bernhard at b:~/src/benchmark$ time ./1Mhello >/dev/null

real    0m1.007s
user    0m0.960s
sys     0m0.010s

Give some examples for python. I'll run them on my machine if you 
don't have a campareble one.

Sure, this benchmark sucks, but it's not completely bogus. Any 
ideas about some more serious benchmarks? Going towards the 
strengths of each language would be somehow unfair, so a rather 
complex problem may be best but also difficult to implement. OTOH 
picking the language that offers the most advantages for a given 
problem is the way to go.

> Maybe dilettante springs to mind as a description that fits.

Your insults are getting boring.


Webspace; Low end Serverhousing ab 15 e, etc.: http://www.bksys.at
Linux Admin/Programmierer: http://bksys.at/bernhard/services.html

More information about the Mailman-Developers mailing list