PHP 4.0 Bug #2662: Strange echo/printf perfomance

From: Date: Thu, 04 Nov 1999 09:19:37 +0000
Subject: PHP 4.0 Bug #2662: Strange echo/printf perfomance
Groups: php.dev 
Request: Send a blank email to php-dev+get-12115@lists.php.net to get a copy of this message
From: webmaster@softgallery.com Operating system: Debian 2.0r3 PHP version: 4.0 Latest CVS (04/11/1999) PHP Bug Type: Performance problem Bug description: Strange echo/printf perfomance here is a little script : <? include "time.inc"; Begin_Timer(); for ($i=0;$i<63000;$i++) { $string .= "a"; } Show_Timer(); Begin_Timer(); echo $string; Show_Timer(); ?> from an http client on the SAME machine the output is : <!Elapsed time : 0.300685> lots of a <!Elapsed time : 0.000917> Everything is normal BUT if I get the page from another machine on the same (non busy) network the output is: <!Elapsed time : 0.299803> lots of a <!Elapsed time : 3.021531> I tried with output buffering on and off, same results. doing a for ($i=0;$i<strlen($string);$i++) echo $string[$i]; is even faster.

« previous php.dev (#12115) next »