In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Daniel Grace) wrote:
> Comments? I was expecting the numbers to be very similiar -- rather shocked
> that the PERL ended up being about 2.5x as fast as PHP was.

As Rasmus says, one of the things Perl was designed for was speed. The 
Perl designers really take speed seriously for things like this, because 
Perl tends to be used for things like looping over a few million lines 
of text. I resisted Perl for a long time because of its somewhat odd 
syntax, but the first time I programmed in it seriously, the main thing 
that wasted my time was that I didn't believe my program was working; I 
was re-writing a log analysis program; the previous version, in a 
different language (which did other things very well but wasn't designed 
for looping at all) took about 6 hours to complete an analysis. It was 
getting to where I could foresee that the daily log analysis was going 
to take longer than a day!

I couldn't get the Perl program to do anything. It seemed to work on the 
short test data, but on the full file I'd type the command and it would 
just drop right back to the command line. Of course the program was 
working fine--Perl was doing its work almost instantaneously.

Each language has its advantages; I tend to use PHP for web pages, but 
there are times I'd like to easily switch back and forth between PHP and 
Perl on the same page. Perl makes great filters.

"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to