Gunnar Hjalmarsson said:
Now i'm confused. If you don't run your Perl program under mod_perl or
something similar, it's compiled every time it's called. The
compilation costs CPU. (Please correct me if I'm wrong so far.)
This is not specific to Perl, it applies ti any 'scripting'-type
language which is not precompiled. For instance, if you don't run your
PHP program under mod_php or similar, it's compiled (or re-parsed, or
whatever PHP does) every time.
Of course. But you can't do anything about the need to compile.
You can do many things: use mod_perl or fastCGI, compile to bytecode,
write a separate server process that does most of the processing,
write the program so as not to load modules unless they're needed...
The question in the subject line of this thread may not be possible to
answer. But for a particular application area I really thought is was
not only possible, but also advisable, to consider which programming
language is the better choice out from various viewpoints - also CPU
usage. If you guys disagree on that, I must have missed something.
You are of course right in both cases
. In general, the question is
unanswerable, except for generalities like 'well-written C tends to be
faster' and 'Lisps tend to be slow'. In specific cases, language may
make a difference: in particular, if your ISP provides mod_php and not
mod_perl you should either switch ISP or use PHP.
Ben