Re: Re: Shootout

From: Date: Sat, 29 Dec 2001 17:23:30 +0000
Subject: Re: Re: Shootout
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-75257@lists.php.net to get a copy of this message
For that particular case, btw, you should try adding in the Zend Optimizer. For this type of somewhat braindead code (no insult intended, it's just not very real-world), it would give you a very serious performance boost. 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/

« previous php.dev (#75257) next »