php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2662 Strange echo/printf perfomance
Submitted: 1999-11-04 04:19 UTC Modified: 2000-03-17 05:35 UTC
From: webmaster at softgallery dot com Assigned:
Status: Closed Package: Performance problem
PHP Version: 4.0 Latest CVS (04/11/1999) OS: Debian 2.0r3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: webmaster at softgallery dot com
New email:
PHP Version: OS:

 

 [1999-11-04 04:19 UTC] webmaster at softgallery dot com
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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-09 21:17 UTC] joey at cvs dot php dot net
Could you please check CVS or a snapshot and
see if you still experience this behavior?

Snapshots at http://snaps.php.net

 [2000-03-17 05:35 UTC] andi at cvs dot php dot net
No response from the user. Please open a new bug report if you still experience such problems.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 07:01:33 2025 UTC