PHP versus Perl for server load? – PHP

  php

Q(Question):

I’ve read comparison of Perl vs. PHP regarding features and coding, however
I would like to know how each affects server load.

I am looking at two scripts – one in Perl and the other in PHP – for the
Amazon Product Feed. My understand is that Perl must be compiled on each
execution and that PHP does not, therefore PHP is less of a load on the
server.

Comments, anyone?

A(Answer):

On Fri, 09 Apr 2004 19:34:38 +0000, DesignGuy wrote:

I’ve read comparison of Perl vs. PHP regarding features and coding, however
I would like to know how each affects server load.

I am looking at two scripts – one in Perl and the other in PHP – for the
Amazon Product Feed. My understand is that Perl must be compiled on each
execution and that PHP does not, therefore PHP is less of a load on the
server.

Comments, anyone?

This is normaly the case.. unless the Perl version is written for mod_perl
which acts like PHP (if installed as an ISAPI module).

I don’t have any benchmarks to offer or the likes.. but if a "normal" Perl
script, it invokes a copy of Perl everytime the script is executed.

Others may have better info.. but I haven’t used Perl for Web development
for years.

Regards,

Ian


Ian.H
digiServ Network
London, UK
http://digiserv.net/

A(Answer):

which two scripts are you comparing? there are about 5-6 in php and 3 in
perl.

I’ve read comparison of Perl vs. PHP regarding features and coding,
however I would like to know how each affects server load.

I am looking at two scripts – one in Perl and the other in PHP – for the
Amazon Product Feed. My understand is that Perl must be compiled on each
execution and that PHP does not, therefore PHP is less of a load on the
server.

Comments, anyone?

A(Answer):

"Finding Best Hosting" <ho*****@us.us> wrote in message
news:3T*******************@bgtnsc04-news.ops.worldnet.att.net…

which two scripts are you comparing? there are about 5-6 in php and 3 in
perl.

MrRats’s Perl Script
ThinkBling’s PHP script

A(Answer):

I tried both scripts, and did not like either.

Thinkbling sucks. Don’t use it.
The layout is not so good. And it uses popup for reviews and descriptions.
But I think they use a MySQL for saving downloading from amazon every time.

mrrat is ok, but Perl is really not for HTML programming. Perl is great for
back end stuffs. Do you see how long the cgi is? 129K. wow. In PHP, it only
takes 20k at most. mrrat has a amazon cash file, but I am not sure how often
it refreshes it.

I think Php is faster for complicated processes. I did a test on 2 simple
location redirect scripts. Perl is faster 0.6 second than PHP 0.8 second
from start to finish. I think it is not mod_perl, because I did a ENV test,
and there is no Mod_Perl mentioned. I guess PHP’s regular expression etc is
slower, but the start process is faster, and takes less memory, so in long
run, PHP kicks ass. But PHP has too many bugs.

By the way, do you see anything similar for ebay? Would it be nice to search
amazon and ebay together?

"Finding Best Hosting" <ho*****@us.us> wrote in message
news:3T*******************@bgtnsc04-news.ops.worldnet.att.net…

which two scripts are you comparing? there are about 5-6 in php and 3 in
perl.

MrRats’s Perl Script
ThinkBling’s PHP script

A(Answer):

DesignGuy <do********@nowhere.com> wrote:

I’ve read comparison of Perl vs. PHP regarding features and coding, however
I would like to know how each affects server load.

I am looking at two scripts – one in Perl and the other in PHP – for the
Amazon Product Feed. My understand is that Perl must be compiled on each
execution and that PHP does not, therefore PHP is less of a load on the
server.

I believe that is false. I *used to* believe PHP only had to be
compiled once, but have been informed that unless using commercial
products, PHP is compiled each time, just like perl.

PHP’s advantage is that the interpreter doesn’t need to be loaded each
time, while vanilla perl needs to load /usr/bin/perl AND compile the
perl script. (perl syntax is a bit more, shall we say.. ‘complex’.. so
I’d imagine perl’s parse & compile step is a little more expensive)

At least, thats my understanding of PHP "today". I could be wrong, it
would be nice if the compiled version were cached some place.

mod_perl is typically faster than PHP because it can store compiled code
(and data structures) but.. mod_perl is less stable and not as available
as PHP. (mod_perl doesn’t work too good when the web server needs to be
shared between multiple users) Mod_perl is also a LOT more difficult to
"get right". (database handles, stale variables and making sure
any HTML templates take advantage of a compiled cache)

Generally, I’ve found PHP to be faster than perl except with mod_perl.

For really really serious stuff, I’d check into Servlets/JSP or
mod_perl. For wider availability or smaller scale, I’ve found PHP
better.

Jamie

A(Answer):

If something about ThinkBling.com’s scripts "Sucks" we would like to hear about.

forums.thinkbling.com is an open discussion.

The description pop-ups are being reconsidered.

www.ThinkBling.com
For all that is BLING!
An Amazon search alternative

LEAVE A COMMENT