Perl vs C: CGI speed question 
Author Message
 Perl vs C: CGI speed question


Quote:



>> theoretically (I've never tried it), if you compile the perl script into
>> a binary form (using dump and a few things I've picked up on), then it
>> should be up there with C for it's speed...

This is FALSE.

Using 'undump' you can make a binary that contains the perl interpreter
and the P-code for a perl program, and since the source has already been
rendered into the more compact form, _startup_ of the program will be faster,
but the program will run just as slowly as regular perl scripts.

A well-written PERL program will always be slower than an equally well-written
C program. On the same basis, a well written C program will always be slower
than an equally well-written assembly program. Optimizing interpreters and
compilers can make up for this to some degree, but a smart programmer is
still better (and rarer/more expensive) than the smartest program.

It's just that it's (generally) faster to write in a high-level language, and
while there's probably only a couple hundred GOOD assembly programmers for
any given architecture, but there are thousands of good PERL programmers
and tens of thousands of dabblers :)

Quote:
>I would be very pleased if compiling a perl script were possible.  Could
>someone please explain in more detail how to do this?  Simple language
>would be appreciated, as I am an inexperienced "programmer."

The most efficient solution is to learn to be a good C programmer, and convert
the time critical and CPU-dependent portions of your PERL script into C.


Fri, 13 Mar 1998 03:00:00 GMT  
 Perl vs C: CGI speed question
        Compiled perl?? try:
        http://www.afternet.com/~michaelm/old_public/perl/compile_perl.html

        -Andy



Sat, 14 Mar 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. AWK vs PERL speed question

2. Perl vs. C speed question

3. AWK vs PERL speed question

4. Speed question: patern matching vs. spliting

5. Sorting Speeds - UNIX vs PERL

6. PHP vs PERL speed when accessing MYSQL database

7. Add to FAQ: C vs Perl speed

8. C vs Perl speed?

9. on speed of C vs Perl (using C library)

10. perl vs ksh speed

11. TCL Speed vs PERL

12. Perl vs SQL search speed advice please

 

 
Powered by phpBB® Forum Software