On Sat, May 11, 2002 at 04:09:43PM +0200, Arpi wrote:

| (yes, i agree on that perl is usefull thing for text processing, but it is
| no more true when high performance does matter - then asm+c kicks in)

This completely depends.  First you MUST *profile* to determine where
the hotspots are.  Maybe _those_ pieces of the program would be better
in C or ASM.  Remember that 90% of the execution time is spent in 10%
of the code (generally).  Rewrting the remaining 90% of the code in a
lower-level language is a waste of time and won't help.  SA might not
quite fit the general rule because of it's heavy regex use and much
less other processing.  That simply means two things :
    1)  profile, then improve the hotspots (regexes)
    2)  As you suggested, do some sort of pre-test to avoid running
        some of the slower regexes.
Both of these can be done in perl and don't require a rewrite in C.

Note that I'm not saying that there is no possibility that a rewrite
in C could have an improvement.  It all depends on where the hotspots
are, what it would take to improve them, and the quality of the
programmer.  In the "Language Shootout" (IEEE Computer Magazine
article) it was demonstrated that C programd _can_ be faster and
use less memory, AND they can be slower and/or use more memory than
equivalent programs written in higher level languages like perl or
python.

The only argument I'm making is against the preconceived notion that a
program in C is always faster than the same program in perl.

(if that were true, then ASM programs would be faster than C, but we
know that is false because the compiler's optimizer is usually better
than me)

(it would also follow that machine-language programs are faster than
ASM programs, but that can't be true because ASM is assembled into
machine language anyways!  It's just easier to read and write ascii
mnemonics than raw bits)


As for production use, run multiple spamds on separate machines and
use round-robin DNS to share the load.  Or build a mosix or beowulf
cluster to do the load-balancing across multiple machines.  If you
have that much continuous mail traffic then you can certainly afford
the hardware to do that.

-D

-- 

If we claim to be without sin, we deceive ourselves and the truth is not
in us.
        I John 1:8
 
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg

Attachment: msg04789/pgp00000.pgp
Description: PGP signature

Reply via email to