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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC