Re: Re: Shootout
| From: | Zeev Suraski | Date: | Sat, 29 Dec 2001 16:57:16 +0000 |
| Subject: | Re: Re: Shootout | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-75254@lists.php.net to get a copy of this message | ||
Could you specify which $n you were using, and also provide the equivalent
Perl script that you used?
Zeev
On Sat, 29 Dec 2001, August Zajonc wrote:
> > This is not really surprising, and the test is not really fair, the
> > PHP code is not written by an experienced php programmer, and thus,
> > would naturally be slower, on person benchmarks like this are simply
> > too dependent on the person writing the code.
> > -Sterling
>
> Give me a break.
>
> Did you even check a SINGLE one of the routines? Since you ARE an
> experienced php programmer I'm attaching the nested loop test where PHP
> scored at the BOTTOM of all 30 languages for you to optimize. I mean, I
> looked over a number of the snippets and they are very straightforward,
> especially the "same way" tests.
>
> This type of knee-jerk (and spectacularly uninformed) discounting of results
> gets us nowhere and as you can probably tell irritates me no end :). There
> are too many folks too quick to sound authoratative on an issue. Read
> through the site, Doug is aware of the problems in benchmarking (everyone
> who has ever tried doing them is probably aware) and worked hard to overcome
> many of them.
>
> Anyways, the challenge is down, here's the code, optimize away. Then we can
> talk about the real causes for PHP slow performance :) They still may be as
> trivial as bad compile time or config settings but I think this bad php
> programmer thing is a red herring.
>
> - August
>
> <?php/*
> $Id: nestedloop.php,v 1.1 2001/05/06 06:13:21 doug Exp $
> http://www.bagley.org/~doug/shootout/
> */
> $n = ($argc == 2) ? $argv[1] : 1;
> $x = 0;
> for ($a=0; $a<$n; $a++)
> for ($b=0; $b<$n; $b++)
> for ($c=0; $c<$n; $c++)
> for ($d=0; $d<$n; $d++)
> for ($e=0; $e<$n; $e++)
> for ($f=0; $f<$n; $f++)
> $x++;
> print "$x\n";
> ?>
> Perl took 18 CPU secs, PHP 85.
>
>
>
>
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/