bladx has asked for the wisdom of the Perl Monks concerning the following question:

Hi everyone, I know this type of question has already been asked Compare Perl vs PHP but this is a different question. For where I work, I need to find out which language is faster in order to use the more efficient language for what we are doing for our upcoming site.

I was wondering if PHP was faster than ModPerl when parsing a request, or form, for a given webpage. Thank you in advance for any help that anyone might have on this subject for my work!!

bladx ~ ¡muchas veces tengo preguntas!
  • Comment on Which language parses faster? PHP or Mod_Perl?

Replies are listed 'Best First'.
Re: Which language parses faster? PHP or Mod_Perl?
by chromatic (Archbishop) on Apr 01, 2001 at 01:44 UTC
    Yes. No.

    It's too broad a question. What kind of hardware do you have? What kind of network connection do you have? What kind of program are you running? What kind of "efficient" do you mean? Do you have a database? On the same machine, on a different machine? What kind of accesses are you likely to receive? Do you have more CPU time to burn than available memory? Is your system IO bound or network bound or processor bound?

    There are a thousand variables. We won't even get into the version of Perl, mod_perl, any performance tweaks you might get into, whether or not you have the Zend optimizer or not.

    You can write bad and inefficient code in any language. You can write good code in almost any language. Pick the language that will cause your programmers the least grief, because you will have to change things. Then, if it's not fast enough, either fix it, or figure out which parts you can rewrite in a faster language. If absolutely necessary.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Which language parses faster? PHP or Mod_Perl?
by Coyote (Deacon) on Apr 01, 2001 at 11:05 UTC
    The now defunct Perl Month, ran a feature some time ago benchmarking mod_perl, perl cgi, php4, asp, java servlets, and a few perl based templating systems. The article is a bit dated but you can find the article here.

    I recently ported a fairly elaborate web based quiz application from PHP to perl and I haven't noticed any significant speed difference between the PHP and perl versions. Keep in mind that your biggest bottleneck will most likely be network related.

    Given the choice between perl and PHP, I would definately go with perl. The perl version of my application turned out much cleaner than the PHP version primarily due to CPAN, DBI, the Template Toolkit and use strict. PHP still seems a bit rough around the edges to me.

    ----
    Coyote