ID:               35054
 User updated by:  starcitsura at shaw dot ca
 Reported By:      starcitsura at shaw dot ca
-Status:           Feedback
+Status:           Closed
 Bug Type:         Performance problem
 Operating System: Linux
 PHP Version:      4.4.1RC1
 New Comment:

nevermind then


Previous Comments:
------------------------------------------------------------------------

[2005-11-01 22:26:17] [EMAIL PROTECTED]

Are you sure it's not Apache or Mysql lagging? Where do you get the
idea it's automatically PHP's fault? Can you provide a script which can
be run in CLI and which does NOT use mysql?
(and which is actually complete script and not just useless piece of a
huge one)


------------------------------------------------------------------------

[2005-11-01 18:41:16] starcitsura at shaw dot ca

Description:
------------
For some reason there is random lag when echoing the results.
Now I say random lightly because there seems to be a tendency for
certain items to be more likely to slow down then others, for instance
at one point I ran the script about 10 times, and item six in the list
always slowed down.

The lag seemed to occur inside the part that echoed each image and
link, at that time the lag would only occur on the image for the down
button which makes even less sense.
I used a micro time function that would echo the time since the last
one was called. The lag seemed to occur during the html portion of the
code., which doesn’t make much sense to me.

What is causing this lag? I have also written the code so that it
echo’s the html instead of the way its done now, there was no effect on
the lag

I wouldn't be worried about it if it was only like 15 milliseconds
difference, but the lag varies anywhere from 100 ms to 1500ms which is
not acceptable. Some time’s the list is as long as 100 items, in which
case the items with lag are much more common, causing the script to
take as long a 10000ms.

I have tested this script on two different servers, the lag occurs on
both.
The main server uses PHP 4.3.11


Reproduce code:
---------------
foreach($array as $value)
{
  $conID = substr($value, 1);
  switch ($value{0})
  {   #simply choses which mysql query to run, then runs it  }
  list($name,$built) = $data;
  $data = new entity($name);
  $cost = $data->fetchField('Cost'); ?>
<li><?=$name;?> (<?=($cost-$built);?>/<?=$cost;?>)
<a href="?LID=<?=$LID;?>&amp;conID=<?=$value{0}.$conID;?>&amp;shift=up"
title="Up">
<img alt="Up" src="../../images/ingame/map/up.gif" height="11"
width="11" /></a>
<a href="?LID=<?=$LID;?>&amp;conID=<?=$value{0}.$conID;?>&amp;shift=x"
title="Cancel">
<img alt="Cancel" src="../../images/ingame/map/x.gif" height="11"
width="11" /></a>
</li>
<?php
}




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35054&edit=1

Reply via email to