On Apr 27, 2004, at 3:37 AM, John W. Krahn wrote:
Sumanth Sharma wrote:
[..]
Are there instances/scenarios where Perl can really be faster that
C/C++. (Do not include coding or design time here, consider only run-time).

Yes. Check out this URL for proof. :-) http://cm.bell-labs.com/cm/cs/who/bwk/interps/pap.html

Sorry to have missed this discussion last month...

Another way of presenting the problem of
comparing apples to banana's would be

        which is faster building one's cgi code in raw Perl
        or should I build it with mod_perl so that it compiles once
        and then just runs.

So a part of the core issue of 'should this be in c89 or Perl?'
is what are you really trying to solve.

If the c-coder is not afraid of optimizing for the OS that
the code is targetted for - then they can cut down on the
overall size of their code at 'run time' in ways that
Perl Coders can not do - since they need the ref_count
and run time environment.

Similarly there are tricks that the Perl Coder can
pull off far faster and far simpler outside of the
'canonical code' that will not require the ECR ( engineering
change requrest ) to get routed ... As a specific

        Gee you want to fix that in the lex and yacc
                or should I just write the hack in Perl to do
                what needs to be done for this other app?

and if you know lex and yacc, you know that the answer was

        "yeah, just pop the regEx in Perl it will be simpler"

Whereas there is a lot of stuff that is much closer to
the OS specifics that are easier to write and maintain
in a 'c-code' source that one builds an XS module to
expose to the Perl Coders as the compromise.

        cf: perldoc h2xs

So use the correct Swiss Army Chainsaw on the problem.

ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to